Raja has Published 760 Articles

How can we change the background and foreground color of a JTooltip in Java?

raja

raja

Updated on 10-Feb-2020 12:44:49

231 Views

A JToolTip is a subclass of JComponent class and we can create a tooltip for any java component by using setToolTipText() method, it can be used to set up a tooltip for the component. The important methods of a JToolTip class are getAccessibleContext(), getComponent(), paramString() and updateUI(). We can change both the background and ... Read More

How to set the shortcut key to a JCheckBox in Java?

raja

raja

Updated on 10-Feb-2020 12:26:50

187 Views

A JCheckBox is a subclass of JToggleButton and it can be a small box that is either checked or unchecked. When we click on a JCheckBox, it changes from checked to unchecked or vice versa automatically. A JCheckBox can generate an ActionListener or ItemListener whenever the checkbox is changed. We can set the shortcut keys to ... Read More

How can we hide left/right pane of a JSplitPane programmatically in Java?

raja

raja

Updated on 10-Feb-2020 11:28:46

341 Views

A JSplitPane is a subclass of JComponent class that allows us to arrange two components side by side horizontally or vertically in a single pane. The display areas of both components can also be adjusted at the runtime by the user. The important methods of JSplitPane are remove(), removeAll(), resetToPreferredSizes() and setDividerLocation(). A JSplitPane ... Read More

How can we add/insert a JButton to JTable cell in Java?

raja

raja

Updated on 10-Feb-2020 11:10:47

6K+ 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. We can add or insert a JButton to JTable ... Read More

How to implement the search functionality of a JTable in Java?

raja

raja

Updated on 10-Feb-2020 10:57:34

3K+ Views

A JTable is a subclass of JComponent 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 implement the search functionality of a JTable ... Read More

How can we set a background color to JSplitPane in Java?

raja

raja

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

329 Views

A JSplitPane is a subclass of JComponent class that allows us to arrange two components side by side horizontally or vertically in a single pane. The display areas of both components can also be adjusted at the runtime by the user. The important methods of JSplitPane are remove(), removeAll(), resetToPreferredSizes() and setDividerLocation(). A JSplitPane ... Read More

How can we show a popup menu when the user right-clicks on a JComboBox in Java?

raja

raja

Updated on 10-Feb-2020 10:50:35

352 Views

A JComboBox is a subclass of JComponent class that displays a drop-down list and gives users options that we can select one and only one item at a time. A JComboBox can be editable or read-only. A getSelectedItem() method can be used to get the selected or entered item from a combo box. We ... Read More

How to change the position of a JSlider to horizontal/vertical programmatically in Java?

raja

raja

Updated on 10-Feb-2020 10:48:18

285 Views

A JSlider is a subclass of JComponent class and it is similar to scroll bar which allows the user to select a numeric value from a specified range of integer values. It has a knob which can slide on a range of values and can be used to select a particular value. ... Read More

How to set a tooltip to each column of a JTableHeader in Java?

raja

raja

Updated on 10-Feb-2020 10:46:28

737 Views

A JTableHeader is a subclass of JComponent class, When we create a JTable object, the constructor creates a new JTableHeader object to manage the table component's header. A JTable supplies a setTableHeader() method that establishes the table header component's JTableHeader object and a getTableHeader() method that returns a reference to the table ... Read More

How can we set the orientation of a JTextArea from right to left in Java?

raja

raja

Updated on 10-Feb-2020 10:43:39

865 Views

A JTextArea is a subclass of JTextComponent class and it is a multi-line text component to display the text or allow a user to enter the text. A JTextArea can generate a CaretListener interface when we are trying to implement the functionality of the JTextArea. By default, a JTextarea allows the orientation from left ... Read More

Advertisements