Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import java.awt.BorderLayout;
- import javax.swing.JPanel;
- import javax.swing.JMenuBar;
- import javax.swing.JMenu;
- import javax.swing.JMenuItem;
- import javax.swing.JLabel;
- import javax.swing.JTextField;
- import net.miginfocom.swing.MigLayout;
- import javax.swing.JComboBox;
- import javax.swing.JCheckBox;
- import javax.swing.JTabbedPane;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JButton;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- import java.awt.GridLayout;
- import javax.swing.JEditorPane;
- public class Gui {
- private JFrame frmWebappswordSdk;
- private JTextField textField;
- private JPanel submodulesPanel;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Gui window = new Gui();
- window.frmWebappswordSdk.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public Gui() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frmWebappswordSdk = new JFrame();
- frmWebappswordSdk.setTitle("App");
- frmWebappswordSdk.setBounds(100, 100, 478, 348);
- frmWebappswordSdk.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frmWebappswordSdk.getContentPane().setLayout(new BorderLayout(0, 0));
- JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
- frmWebappswordSdk.getContentPane().add(tabbedPane, BorderLayout.CENTER);
- JPanel info = new JPanel();
- tabbedPane.addTab("Info", null, info, null);
- info.setLayout(new MigLayout("", "[311px][grow]", "[16px][16px][][][grow]"));
- JLabel nameLabel = new JLabel("Name");
- info.add(nameLabel, "flowx,cell 0 0,alignx left");
- textField = new JTextField();
- info.add(textField, "cell 1 0,alignx left");
- textField.setColumns(20);
- JLabel langLabel = new JLabel("Lang");
- info.add(langLabel, "cell 0 1,alignx left");
- JComboBox comboBox = new JComboBox();
- comboBox.setModel(new DefaultComboBoxModel(new String[] {"PHP"}));
- info.add(comboBox, "cell 1 1,growx");
- JLabel methodsLabel = new JLabel("Methods");
- info.add(methodsLabel, "cell 0 2,alignx left");
- JCheckBox chckbxNewCheckBox = new JCheckBox("New check box");
- info.add(chckbxNewCheckBox, "flowy,cell 1 2");
- JLabel submodulesLabel = new JLabel("Submodules");
- info.add(submodulesLabel, "cell 0 3,alignx left");
- JCheckBox chckbxNewCheckBox_1 = new JCheckBox("New check box");
- info.add(chckbxNewCheckBox_1, "cell 1 2");
- JButton addSubmoduleButton = new JButton("+");
- addSubmoduleButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- System.out.println(textField.getText());
- JComboBox comboBox_2 = new JComboBox();
- submodulesPanel.add(comboBox_2);
- }
- });
- info.add(addSubmoduleButton, "flowx,cell 1 3,aligny baseline");
- submodulesPanel = new JPanel();
- info.add(submodulesPanel, "cell 1 4,grow");
- submodulesPanel.setLayout(new GridLayout(0, 1, 0, 0));
- JComboBox comboBox_2 = new JComboBox();
- submodulesPanel.add(comboBox_2);
- JPanel installers = new JPanel();
- tabbedPane.addTab("Installers", null, installers, null);
- installers.setLayout(new GridLayout(0, 1, 0, 0));
- JEditorPane editorPane = new JEditorPane();
- installers.add(editorPane);
- JPanel validators = new JPanel();
- tabbedPane.addTab("Validators", null, validators, null);
- validators.setLayout(new GridLayout(1, 0, 0, 0));
- JEditorPane editorPane_1 = new JEditorPane();
- validators.add(editorPane_1);
- JMenuBar menuBar = new JMenuBar();
- frmWebappswordSdk.getContentPane().add(menuBar, BorderLayout.NORTH);
- JMenu mnFile = new JMenu("File");
- menuBar.add(mnFile);
- JMenuItem mntmNew = new JMenuItem("New");
- mnFile.add(mntmNew);
- JMenuItem mntmOpen = new JMenuItem("Open");
- mnFile.add(mntmOpen);
- }
- }
Add Comment
Please, Sign In to add comment