Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5.  
  6. /*
  7. * UserInterface.java
  8. *
  9. * Created on 26-jan-2011, 16:37:45
  10. */
  11.  
  12. /**
  13. *
  14. * @author martijnzijlstra
  15. */
  16. public class UserInterface extends javax.swing.JFrame {
  17.  
  18. /** Creates new form UserInterface */
  19. public UserInterface() {
  20. initComponents();
  21. }
  22.  
  23. /** This method is called from within the constructor to
  24. * initialize the form.
  25. * WARNING: Do NOT modify this code. The content of this method is
  26. * always regenerated by the Form Editor.
  27. */
  28. @SuppressWarnings("unchecked")
  29. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  30. private void initComponents() {
  31.  
  32. jScrollPane1 = new javax.swing.JScrollPane();
  33. jList1 = new javax.swing.JList();
  34. jScrollPane2 = new javax.swing.JScrollPane();
  35. jList2 = new javax.swing.JList();
  36. jButton1 = new javax.swing.JButton();
  37. jLabel1 = new javax.swing.JLabel();
  38. jLabel2 = new javax.swing.JLabel();
  39.  
  40. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  41.  
  42. jList1.setModel(new javax.swing.AbstractListModel() {
  43. String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
  44. public int getSize() { return strings.length; }
  45. public Object getElementAt(int i) { return strings[i]; }
  46. });
  47. jScrollPane1.setViewportView(jList1);
  48.  
  49. jList2.setModel(new javax.swing.AbstractListModel() {
  50. String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
  51. public int getSize() { return strings.length; }
  52. public Object getElementAt(int i) { return strings[i]; }
  53. });
  54. jScrollPane2.setViewportView(jList2);
  55.  
  56. jButton1.setText("Start");
  57.  
  58. jLabel1.setText("Attack Mode");
  59.  
  60. jLabel2.setText("Food Type");
  61.  
  62. org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
  63. getContentPane().setLayout(layout);
  64. layout.setHorizontalGroup(
  65. layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  66. .add(layout.createSequentialGroup()
  67. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  68. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
  69. .add(layout.createSequentialGroup()
  70. .addContainerGap()
  71. .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  72. .add(32, 32, 32)
  73. .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 81, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  74. .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
  75. .addContainerGap()
  76. .add(jLabel2)
  77. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  78. .add(jLabel1)))
  79. .add(layout.createSequentialGroup()
  80. .add(78, 78, 78)
  81. .add(jButton1)))
  82. .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  83. );
  84. layout.setVerticalGroup(
  85. layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  86. .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
  87. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
  88. .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
  89. .add(44, 44, 44)
  90. .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE))
  91. .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
  92. .addContainerGap()
  93. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  94. .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  95. .add(jLabel2))
  96. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  97. .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 95, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
  98. .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
  99. .add(jButton1)
  100. .addContainerGap())
  101. );
  102.  
  103. pack();
  104. }// </editor-fold>
  105.  
  106. /**
  107. * @param args the command line arguments
  108. */
  109. public static void main(String args[]) {
  110. java.awt.EventQueue.invokeLater(new Runnable() {
  111. public void run() {
  112. new UserInterface().setVisible(true);
  113. }
  114. });
  115. }
  116.  
  117. // Variables declaration - do not modify
  118. private javax.swing.JButton jButton1;
  119. private javax.swing.JLabel jLabel1;
  120. private javax.swing.JLabel jLabel2;
  121. private javax.swing.JList jList1;
  122. private javax.swing.JList jList2;
  123. private javax.swing.JScrollPane jScrollPane1;
  124. private javax.swing.JScrollPane jScrollPane2;
  125. // End of variables declaration
  126.  
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement