Raja has Published 760 Articles

How to restrict the number of digits inside JPasswordField in Java?

raja

raja

Updated on 12-Feb-2020 07:02:45

313 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. The important methods of JPasswordField are getPassword(), getText(), getAccessibleContext() and etc. By default, we can enter any number of digits inside JPasswordField. If we want to ... Read More

How can we add different font style items to JList in Java?

raja

raja

Updated on 12-Feb-2020 06:54:41

555 Views

A JList is a subclass of JComponent class and it can be used to display a list of objects that allows the user to select one or more items. A JList can generate a ListSelectiionListener interface and need to implement the abstract method valueChanged(). A DefaultListModel class provides a simple implementation of a list ... Read More

How can we implement transparent JDialog in Java?

raja

raja

Updated on 12-Feb-2020 06:36:45

327 Views

A JDialog is a subclass of Dialog class and it does not hold minimize and maximize buttons at the top right corner of the window. There are two types of dialog boxes namely, modal and non-modal. The default layout for a dialog box is BorderLayout.In the below program, we can implement a transparent JDialog by ... Read More

How can we implement auto-complete JComboBox in Java?

raja

raja

Updated on 12-Feb-2020 06:34:12

1K+ 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 implement auto-complete JComboBox ... Read More

How to select different cells of a JTable programmatically in Java?

raja

raja

Updated on 12-Feb-2020 06:17:43

791 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.In general, a user can select the rows and columns ... Read More

How to detect the value change of a JSlider in Java?

raja

raja

Updated on 12-Feb-2020 05:32:30

786 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. A JSlider has a knob which can slide on a range of values and can be used to select ... Read More

How can we detect the double click events of a JTable row in Java?

raja

raja

Updated on 11-Feb-2020 12:07:15

3K+ Views

A JTable is a subclass of JComponent for displaying complex data structures. A JTable 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 and RowSorterListener interfaces. We can detect the double click events of a JTable by using a ... Read More

What is the importance of JViewport class in Java?

raja

raja

Updated on 11-Feb-2020 11:11:40

344 Views

JViewportA JViewport class defines the basic scrolling model and it is designed to support both logical scrolling and pixel-based scrolling.The viewport's child called the view is scrolled by calling JViewport.setViewPosition() method.A JViewport class supports logical scrolling, that is a kind of scrolling in which view coordinates are not pixels.To support a logical scrolling, JViewport defines a ... Read More

How can we implement the word wrap JTableHeader of a JTable in Java?

raja

raja

Updated on 11-Feb-2020 11:07:07

573 Views

JTableHeaderA 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.The JTableHeader object associated with the table component's column model so that its UI delegate can drag the columns and render each column's header cell.A JTable supplies a setTableHeader() method that establishes the ... Read More

How can we insert multiple tabs into a single JTabbedPane in Java?

raja

raja

Updated on 11-Feb-2020 11:03:45

382 Views

JTabbedPaneA JTabbedPane is a component can extend JComponent class and we can able to see one tab at a time.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.It is also possible to insert multiple tabs ... Read More

Advertisements