Wednesday, 12 May 2021

What is the difference between Combo box and radio button

Difference between Combo box and radio button in java:


  • Combo box is editable. 
    Radio button is non editable.
  • Combo box take less space on screen if multiple values are there.
    Radio button take more space on screen if multiple values are there.
  • Combo box allows us to select from list.
    Radio button allows us to select from group.
  • JComboBox jcbox = new JComboBox();    
    JRadioButton option1 = new JRadioButton("");
  • For Combo box import package is, import javax.swing.JComboBox;
    For radio button import package is, import javax.swing.JRadioButton;



Sunday, 9 May 2021

Combo box in java

What is Combo box in java:

One of the Swing component is JComboxBox which has a drop-down list of choices for user that lets him to selects one of the item from the list.

It allows user to select an item from the list.The combo box can be read only or it can be editable.

The read only combo box is the one from where user can select only one value from the list  (whether the desired value is not there or not).

The editable combo box is the one from where user can select only one value from the list if the desired value is not there then he can enter his own value.

For Combo box import package is, import javax.swing.JComboBox;