Raja has Published 760 Articles

How can we set the margin to a JButton in Java?

raja

raja

Updated on 10-Feb-2020 08:08:54

3K+ Views

A JButton is a subclass of AbstractButton and it can be used for adding platform-independent buttons to a Java Swing application. A JButon can generate an ActionListener interface when the button is pressed or clicked, it can also generate the MouseListener and KeyListener interfaces. We can set a margin to a JButton by using the ... Read More

How to read an input value from a JTextField and add to a JList in Java?

raja

raja

Updated on 10-Feb-2020 08:06:49

1K+ Views

A JList is a subclass of JComponent class that allows the user to choose either a single selection or multiple selections. A JList class itself does not support scrollbar. In order to add scrollbar, we have to use JScrollPane class together with the JList class. The JScrollPane then manages a scrollbar automatically. ... Read More

How can we sort a JTable on a particular column in Java?

raja

raja

Updated on 10-Feb-2020 07:58:40

3K+ Views

A JTable is a subclass of JComponent class for displaying complex data structures. A JTable component can follow the Model View Controller (MVC) design pattern for displaying the data in rows and columns. A JTable can generate TableModelListener, TableColumnModelListener, ListSelectionListener, CellEditorListener, RowSorterListener interfaces. We can sort a JTable in a particular column ... Read More

How can we implement a rounded JTextField in Java?

raja

raja

Updated on 10-Feb-2020 07:56:50

2K+ Views

A JTextField is a subclass of JTextComponent class and it is one of the most important components that allow the user to an input text value in a single-line format. A JTextField class will generate an ActionListener interface when we trying to enter some input inside it. The important methods of a JTextField class ... Read More

How can we show/hide the echo character of a JPasswordField in Java?

raja

raja

Updated on 10-Feb-2020 07:54:35

2K+ Views

A JPasswordField is a subclass of JTextField and each character entered in a JPasswordField can be replaced by an echo character. This allows confidential input for passwords. By default, the echo character is the asterisk(*). The important methods of JPasswordField are get password(),  getText(), getAccessibleContext() and etc. By default, JPasswordField can show the echo characters. We ... Read More

How to display the different font items inside a JComboBox in Java?

raja

raja

Updated on 10-Feb-2020 07:46:53

344 Views

A JComboBox is a subclass of JComponent class and it is a combination of a text field and a drop-down list from which the user can choose a value. A JComboBox can generate an ActionListener, ChangeListener, and ItemListener interfaces when the user actions on a combo box. We can display the different font styles inside ... Read More

How can we show/hide the table header of a JTable in Java?

raja

raja

Updated on 10-Feb-2020 07:44:45

2K+ Views

A JTable is a subclass of JComponent class for displaying complex data structures. A JTable can follow the Model View Controller (MVC) design pattern for displaying the data in rows and columns. The DefaultTableModel class is a subclass of AbstractTableModel and it can be used to add the rows and columns to a JTable dynamically. The ... Read More

How can we prevent the re-ordering columns of a JTable in Java?

raja

raja

Updated on 10-Feb-2020 07:40:06

970 Views

A JTable is a subclass of JComponent class and it can be used to create a table with information displayed in multiple rows and columns. When a value is selected from a JTable, a TableModelEvent is generated, which is handled by implementing a TableModelListener interface. By default, we can do the re-ordering of columns ... Read More

How can we highlight the selected tab of a JTabbedPane in Java?

raja

raja

Updated on 10-Feb-2020 07:37:35

498 Views

A JTabbedPane is a subclass of JComponent class and it can provide easy access to more than one panel. Each tab is associated with a single component that can be displayed when the tab is selected. A JTabbedPane can generate a ChangeListener interface when a tab is selected. We can highlight a selected tab with ... Read More

What is the importance of OverlayLayout in Java?

raja

raja

Updated on 10-Feb-2020 07:35:27

1K+ Views

OverlayLayoutAn OverlayLayout is a subclass of Object class and it can arrange the components over the top of each other and uses components specified alignments to position them relatively.When different sizes are given to any of the components, we can see all the components.To align the components over the other or anywhere ... Read More

Advertisements