0% found this document useful (0 votes)
13 views1 page

Practical No 6

Ajp practical 6

Uploaded by

mpvrsmshriram807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Practical No 6

Ajp practical 6

Uploaded by

mpvrsmshriram807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical No 6

Title: Write a program using swing to display a ScrollPane and


JComboBox in an JApplet with the items-English,Marathi,Hindi,Sanskrit.

Program:
import javax.swing.*;
import java.awt.*;
public class ScrollPaneComboBoxFrame {
public static void main(String[] args) {
JFrame frame = new JFrame("ScrollPane and JComboBox Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 200);
frame.setLayout(new BorderLayout());
String[] languages = {"English", "Marathi", "Hindi", "Sanskrit"};
JComboBox<String> comboBox = new JComboBox<>(languages);
JPanel panel = new JPanel();
panel.add(comboBox);
JScrollPane scrollPane = new JScrollPane(panel);
frame.add(scrollPane, BorderLayout.CENTER);
frame.setVisible(true);
}
}
Output:

You might also like