.


:




:

































 

 

 

 





Component

Component AWT . AWT , [1].

.

 

( int) x y. Java x , , , , , .

Point (). public int x y, . Point AWT, .

. setLocation(), , Point. getLocation(), Point, getX() getY()[1].

 

, AWT , width () height (). Dimension (), public int width height, .

setSize, , Dimension. getSize(), Dimension, getWidth() getHeight().

. , , (x, y, width, height), Point Dimension, Rectangle ().

setBounds, , Rectangle. getBounds(), Rectangle.

 

, . visible. setVisible, , isVisible, .

 

, . , . disabled. , enabled. , , (, , ), , , ( ).

setEnabled, (true enabled, false disabled), isEnabled.

 

, . , , foreground background . , , .. , , , , .

AWT Color. , .

3 , RGB, , , . 0 255 ( , int). (0, 0, 0) , (255, 255, 255) .

Color , , , - , RGB . Color , : , , , . , , (0, 0, 255), Color.blue Color.BLUE ( ).

foreground setForeground getForeground, background setBackground getBackground.

 

Container

Container, Component, , . . . add, remove removeAll ( ).

, , , . , , , :

getComponent(int n) ;

getComponents() ; getComponentCount() ;

getComponentAt(int x, int y) (Point p) , ;

findComponentAt(int x, int y) (Point p)

, .

(location) . , , . , getLocationOnScreen.

size. . , ( , , ).

Component, , , , . . , . , AWT. .

 





:


: 2018-10-18; !; : 201 |


:

:

, , . , .
==> ...

1382 - | 1220 -


© 2015-2024 lektsii.org - -

: 0.012 .