Raja has Published 760 Articles

How can we disable the maximize button of a JFrame in Java?

raja

raja

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

2K+ Views

A JFrame is a class from javax. swing package and it can extend java.awt.frame class. It is a top-level window with a border and a title bar. A JFrame class has many methods that can be used to customize it.After setting the size of a JFrame we can still change the size by ... Read More

What is the importance of the GridBagConstraints class in Java?

raja

raja

Updated on 07-Feb-2020 10:57:12

2K+ Views

A GridBagLayout is a very flexible layout manager that allows us to position the components relative to one another using constraints. Each GridBagLayout uses a dynamic rectangular grid of cells with each component occupying one or more cells called its display area. Each component managed by a GridBagLayout is associated with a GridBagConstraints instance ... Read More

What is the importance of the CardLayout class in Java?

raja

raja

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

124 Views

The functionality of CardLayout arranges the components in a sequential manner and only one component is visible at one time and each component will be treated as one card.CardLayoutThe CardLayout is different from the other layouts where the other layout managers attempt to display all the components within the container at ... Read More

What are the differences between JRadioButton and JCheckBox in Java?

raja

raja

Updated on 07-Feb-2020 07:35:53

2K+ Views

Both JRadioButton and JCheckBox components can extend JToggleButton class, the main difference is that JRadioButton is a group of buttons in which only one button can be selected at a time whereas JCheckBox is a group of checkboxes in which multiple items can be selected at a time.JRadioButtonA JRadioButton is a component that represents an item with ... Read More

What is the importance of SwingUtilities class in Java?

raja

raja

Updated on 07-Feb-2020 07:31:53

1K+ Views

In Java, after swing components displayed on the screen, they can be operated by only one thread called Event Handling Thread. We can write our code in a separate block and can give this block reference to Event Handling thread. The SwingUtilities class has two important static methods, invokeAndWait() and invokeLater() to use ... Read More

What are the different types of JOptionPane dialogs in Java?

raja

raja

Updated on 07-Feb-2020 07:28:45

9K+ Views

The JOptionPane is a subclass of JComponent class which includes static methods for creating and customizing modal dialog boxes using a simple code. The JOptionPane is used instead of JDialog to minimize the complexity of the code. The JOptionPane displays the dialog boxes with one of the four standard icons (question, information, warning, and error) ... Read More

What are the differences between a MouseListener and a MouseMotionListener in Java?

raja

raja

Updated on 07-Feb-2020 07:22:45

958 Views

We can implement a MouseListener interface when the mouse is stable while handling the mouse event whereas we can implement a MouseMotionListener interface when the mouse is in motion while handling the mouse event.Mouse ListenerA MouseEvent is fired when we press, release or click (press followed by release) a mouse button (left or right button) ... Read More

What are the differences between a JComboBox and a JList in Java?

raja

raja

Updated on 07-Feb-2020 07:12:40

2K+ Views

A JComboBox is a component that displays a drop-down list and gives users options that we can select one and only one item at a time whereas a JList shows multiple items (rows) to the user and also gives an option to let the user select multiple items.JComboBoxA JComboBox can be editable or read-only.An ActionListener, ChangeListener or ... Read More

What are the differences between JFrame and JDialog in Java?

raja

raja

Updated on 07-Feb-2020 06:54:28

2K+ Views

JFrameThe components added to the frame are referred to as its contents, these are managed by the contentPane. To add a component to a JFrame, we must use its contentPane instead.A JFrame contains a window with title, border, (optional) menu bar and user-specified components.A JFrame can be moved, resized, iconified and it is not a subclass ... Read More

How can we implement a splash screen using JWindow in Java?

raja

raja

Updated on 07-Feb-2020 06:51:51

488 Views

A JWindow is a container that can be displayed anywhere on the user desktop. It does not have the title bar, window management buttons,  etc like a JFrame.The JWindow contains a JRootPane as its only child class. The contentPane can be the parent of any children of the JWindow. Like a JFrame, a JWindow is another top-level ... Read More

Advertisements