Advertisement
Guest User

gui

a guest
Nov 19th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1.  
  2. package javaapplication23;
  3.  
  4. import javax.swing.JFrame;
  5. import javax.swing.JOptionPane;
  6.  
  7. public class JavaApplication23 {
  8.  
  9.     public static void main(String[] args) {
  10.         int a = Integer.parseInt(JOptionPane.showInputDialog("Please Enter The First Number: "));
  11.         int b = Integer.parseInt(JOptionPane.showInputDialog("Please Enter The Second Number: "));
  12.         JOptionPane.showMessageDialog(null, a*b, "WADU", JOptionPane.WARNING_MESSAGE);
  13.         GUI g = new GUI();
  14.         g.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  15.         g.setSize(400, 400);
  16.         g.setVisible(true);
  17.     }
  18.    
  19. }
  20. ------------------------------
  21.  
  22. package javaapplication23;
  23.  
  24. import java.awt.FlowLayout;
  25. import javax.swing.JFrame;
  26. import javax.swing.JLabel;
  27. import javax.swing.JTextField;
  28.  
  29.  
  30. public class GUI extends JFrame {
  31.     private JLabel label1;
  32.     private JLabel label2;
  33.     private JLabel label3;
  34.    
  35.     public GUI() {
  36.         super("Alinma Bank");
  37.         setLayout(new FlowLayout());
  38.        
  39.         label1 = new JLabel("Username");
  40.         label2 = new JLabel("Password");
  41.         label3 = new JLabel("Secret Code");
  42.        
  43.         label1.setToolTipText("Place For Entering Username.");
  44.         label2.setToolTipText("Place For Entering Password.");
  45.         label3.setToolTipText("Place For Entering Secret Code.");
  46.        
  47.         add(label1);
  48.         add(label2);
  49.         add(label3);
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement