-
-
Save gskielian/11336717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
public class SwingHelloWorld extends JFrame{ | |
public static void main(String[] args){ | |
SwingHelloWorld frame = new SwingHelloWorld("Hello"); | |
frame.setSize(500,500); | |
frame.setVisible(true); | |
} | |
SwingHelloWorld(String title){ | |
setTitle(title); | |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
JPanel panel = new JPanel(); | |
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); | |
JLabel label1 = new JLabel("Bank Simulator"); | |
panel.add(label1); | |
JLabel space = new JLabel(" "); | |
panel.add(space); | |
JLabel label2 = new JLabel("Simulation Time"); | |
panel.add(label2); | |
JTextField editorField = new JTextField(); | |
panel.add(editorField); | |
JLabel label3 = new JLabel("Maximum Transaction Time of Customer"); | |
panel.add(label3); | |
JTextField editorField1= new JTextField(); | |
panel.add(editorField1); | |
JLabel label4 = new JLabel("Enter chances (from 0 to 100) of newcustomer"); | |
panel.add(label4); | |
JTextField editorField2= new JTextField(); | |
panel.add(editorField2); | |
JLabel label5 = new JLabel("Enter the number of Tellers"); | |
panel.add(label5); | |
JTextField editorField3= new JTextField(); | |
panel.add(editorField3); | |
JLabel label6 = new JLabel("Enter the CustomerQ limit"); | |
panel.add(label6); | |
JTextField editorField4= new JTextField(); | |
panel.add(editorField4); | |
JLabel label7 = new JLabel("Enter 1/0 to get data from File/Random"); | |
panel.add(label7); | |
JTextField editorField5= new JTextField(); | |
panel.add(editorField5); | |
Button button2 = new Button("Run Simulation"); | |
panel.add(button2); | |
button2.addActionListener(new ActionListener() { | |
public void actionPerformed(ActionEvent e) { | |
//Execute when button is pressed | |
System.out.println("You clicked the button"); | |
} | |
}); | |
getContentPane().add(panel); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment