Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package TestComboBox;
- import java.awt.Color;
- import javax.swing.*;
- public class TestComboBox extends JFrame{
- public TestComboBox() {
- this.setSize(300,300);
- this.setLayout(null);
- this.setVisible(true);
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- JFrame myFrame = new TestComboBox();
- String[] testStr= {"small", "meduim", "large"};
- JComboBox testBox = new JComboBox(testStr);
- testBox.setBounds(100, 100, 100, 30);
- testBox.setBackground(Color.WHITE);
- myFrame.add(testBox);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement