Guest User

Untitled

a guest
Oct 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. import java.awt.EventQueue;
  2.  
  3. import javax.swing.JFrame;
  4. import java.awt.BorderLayout;
  5. import javax.swing.JPanel;
  6. import javax.swing.JMenuBar;
  7. import javax.swing.JMenu;
  8. import javax.swing.JMenuItem;
  9. import javax.swing.JLabel;
  10. import javax.swing.JTextField;
  11. import net.miginfocom.swing.MigLayout;
  12. import javax.swing.JComboBox;
  13. import javax.swing.JCheckBox;
  14. import javax.swing.JTabbedPane;
  15. import javax.swing.DefaultComboBoxModel;
  16. import javax.swing.JButton;
  17. import java.awt.event.ActionListener;
  18. import java.awt.event.ActionEvent;
  19. import java.awt.GridLayout;
  20. import javax.swing.JEditorPane;
  21.  
  22.  
  23. public class Gui {
  24.  
  25. private JFrame frmWebappswordSdk;
  26. private JTextField textField;
  27. private JPanel submodulesPanel;
  28.  
  29. /**
  30. * Launch the application.
  31. */
  32. public static void main(String[] args) {
  33. EventQueue.invokeLater(new Runnable() {
  34. public void run() {
  35. try {
  36. Gui window = new Gui();
  37. window.frmWebappswordSdk.setVisible(true);
  38. } catch (Exception e) {
  39. e.printStackTrace();
  40. }
  41. }
  42. });
  43. }
  44.  
  45. /**
  46. * Create the application.
  47. */
  48. public Gui() {
  49. initialize();
  50. }
  51.  
  52. /**
  53. * Initialize the contents of the frame.
  54. */
  55. private void initialize() {
  56. frmWebappswordSdk = new JFrame();
  57. frmWebappswordSdk.setTitle("App");
  58. frmWebappswordSdk.setBounds(100, 100, 478, 348);
  59. frmWebappswordSdk.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  60. frmWebappswordSdk.getContentPane().setLayout(new BorderLayout(0, 0));
  61.  
  62. JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
  63. frmWebappswordSdk.getContentPane().add(tabbedPane, BorderLayout.CENTER);
  64.  
  65. JPanel info = new JPanel();
  66. tabbedPane.addTab("Info", null, info, null);
  67. info.setLayout(new MigLayout("", "[311px][grow]", "[16px][16px][][][grow]"));
  68.  
  69. JLabel nameLabel = new JLabel("Name");
  70. info.add(nameLabel, "flowx,cell 0 0,alignx left");
  71.  
  72. textField = new JTextField();
  73. info.add(textField, "cell 1 0,alignx left");
  74. textField.setColumns(20);
  75.  
  76. JLabel langLabel = new JLabel("Lang");
  77. info.add(langLabel, "cell 0 1,alignx left");
  78.  
  79. JComboBox comboBox = new JComboBox();
  80. comboBox.setModel(new DefaultComboBoxModel(new String[] {"PHP"}));
  81. info.add(comboBox, "cell 1 1,growx");
  82.  
  83. JLabel methodsLabel = new JLabel("Methods");
  84. info.add(methodsLabel, "cell 0 2,alignx left");
  85.  
  86. JCheckBox chckbxNewCheckBox = new JCheckBox("New check box");
  87. info.add(chckbxNewCheckBox, "flowy,cell 1 2");
  88.  
  89. JLabel submodulesLabel = new JLabel("Submodules");
  90. info.add(submodulesLabel, "cell 0 3,alignx left");
  91.  
  92. JCheckBox chckbxNewCheckBox_1 = new JCheckBox("New check box");
  93. info.add(chckbxNewCheckBox_1, "cell 1 2");
  94.  
  95. JButton addSubmoduleButton = new JButton("+");
  96. addSubmoduleButton.addActionListener(new ActionListener() {
  97. public void actionPerformed(ActionEvent arg0) {
  98. System.out.println(textField.getText());
  99. JComboBox comboBox_2 = new JComboBox();
  100. submodulesPanel.add(comboBox_2);
  101. }
  102. });
  103. info.add(addSubmoduleButton, "flowx,cell 1 3,aligny baseline");
  104.  
  105. submodulesPanel = new JPanel();
  106. info.add(submodulesPanel, "cell 1 4,grow");
  107. submodulesPanel.setLayout(new GridLayout(0, 1, 0, 0));
  108.  
  109. JComboBox comboBox_2 = new JComboBox();
  110. submodulesPanel.add(comboBox_2);
  111.  
  112. JPanel installers = new JPanel();
  113. tabbedPane.addTab("Installers", null, installers, null);
  114. installers.setLayout(new GridLayout(0, 1, 0, 0));
  115.  
  116. JEditorPane editorPane = new JEditorPane();
  117. installers.add(editorPane);
  118.  
  119. JPanel validators = new JPanel();
  120. tabbedPane.addTab("Validators", null, validators, null);
  121. validators.setLayout(new GridLayout(1, 0, 0, 0));
  122.  
  123. JEditorPane editorPane_1 = new JEditorPane();
  124. validators.add(editorPane_1);
  125.  
  126. JMenuBar menuBar = new JMenuBar();
  127. frmWebappswordSdk.getContentPane().add(menuBar, BorderLayout.NORTH);
  128.  
  129. JMenu mnFile = new JMenu("File");
  130. menuBar.add(mnFile);
  131.  
  132. JMenuItem mntmNew = new JMenuItem("New");
  133. mnFile.add(mntmNew);
  134.  
  135. JMenuItem mntmOpen = new JMenuItem("Open");
  136. mnFile.add(mntmOpen);
  137. }
  138.  
  139. }
Add Comment
Please, Sign In to add comment