

#RESIZE JBUTTON IN FLOWLAYOUT SERIES#
Cele mai importante sunt:Īnother series of classes required for implementing a GUI is the set of classes implementing interface. Aceste clase descriu modul în care elementele se așează într-un Container. O altă serie de clase necesară pentru implementarea unei interfețe grafice este setul de clase care extind interfața. JTextArea is a component where you can add a large text on more than one line. This too can have an associated event handler of type ActionListener which is triggered when Enter is pressed when the text field is focused. JTextField is an area where a short text can be entered, on a single line. It's used by specifying an event handler of type ActionListener (see #Event Handlers) which is triggered when the button is clicked. This can have either a text or an image displayed on top. JLabel is a component used to display text or image in a container. This is particularly useful when reusing a panel. It is recommended not to place elements directly in a JFrame, but in a JPanel that is placed in a JFrame. It can be visible, changing the background color, the image model or having a border, or be invisible, only used for the hierarchy of the content. JPanel is a generic container that can hold other elements. For a more detailed description, read the Oracle tutorial.

Next, we'll present the elements required for task 6.

So, there is a hierarchy of components, each element called parent containing other sub-components called children. This is a JFrame containing the most used elements in Swing:Īll Swing objects, with the exception of class JFrame, inherit class which in turn inherits (indirectly) class. It's the element associated with the horizontal bar containing the icon, application name and the three buttons minimize, maximize and close: The main container class for GUI elements is. The package that contains the majority of classes for Swing applications is java.swing, some other other classes are used from the older package java.awt.
