package test;
import java.awt.BorderLayout;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class ViewEditSelection extends JPanel{
/**
* @param args
*/
public ViewEditSelection(){
super(new BorderLayout());
String[] List = { "View", "Edit" };
JComboBox ViewEdit = new JComboBox(List);
ViewEdit.setSelectedIndex(0);
add(ViewEdit, BorderLayout.PAGE_START);
}
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
JComponent newContentPane = new ViewEditSelection();
newContentPane.setOpaque(true); //content panes must be opaque
frame.setContentPane(newContentPane);
//Display the window.
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}