This shows you the differences between two versions of the page.
| Next revision | Previous revision Next revision Both sides next revision | ||
|
swing:color [2015/05/05 13:03] gthanos created |
swing:color [2015/05/05 13:12] gthanos |
||
|---|---|---|---|
| Line 28: | Line 28: | ||
| </code> | </code> | ||
| - | Αν θέλετε να ορίσετε τα δικά σας αντικείμενα τύπου Color μπορείτε να το κάνετε με ένα από τους κατασκευαστές. | + | Αν θέλετε να ορίσετε τα δικά σας αντικείμενα τύπου Color μπορείτε να το κάνετε με ένα από τους παρακάτω [[https://docs.oracle.com/javase/7/docs/api/java/awt/Color.html#constructor_summary|κατασκευαστές]]. |
| <code java> | <code java> | ||
| Color(ColorSpace cspace, float[] components, float alpha) | Color(ColorSpace cspace, float[] components, float alpha) | ||
| Line 50: | Line 50: | ||
| Color(int r, int g, int b, int a) | Color(int r, int g, int b, int a) | ||
| Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255). | Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255). | ||
| - | |||
| </code> | </code> | ||
| + | |||
| + | ====== Παράδειγμα χρήση της κλάσης Color ====== | ||
| + | |||
| + | Παρακάτω δίνουμε ένα παράδειγμα όπου χρησιμοποιούμε ότι μάθαμε μέχρι τώρα αναφορικά με το Swing framework. Δημιουργούμε ένα παράθυρο και ορίζουμε ως Manager για το content pane του παραθύρου τον [[swing:start#Border Layout Manager|BorderLayout Manager]]. | ||
| + | |||