Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. import javax.swing.JFrame;
  2. import javax.swing.*;
  3. import java.awt.event.*;
  4. import java.awt.*;
  5. import javax.swing.JPanel;
  6. import javax.swing.JLabel;
  7. import javax.swing.JButton;
  8. import javax.swing.JTextField;
  9.  
  10.  
  11. public class qwerty{
  12.  
  13. public static void main(String[] args){
  14.  
  15. JFrame frame = new JFrame("MY Frame");
  16. JPanel panel=new JPanel();
  17. JTextField text1;
  18. JLabel labelD;
  19. JButton button1, button2, button3, button4;
  20.  
  21.  
  22.  
  23.  
  24. frame.setSize(new Dimension(500,700));
  25. frame.setLocation(50, 50);
  26. frame.setVisible(true);
  27.  
  28. frame.add(panel);
  29. frame.setLocationRelativeTo(null);
  30.  
  31. labelD = new JLabel();
  32. labelD.setText("hiiiiiii");
  33. labelD.setBackground(Color.WHITE);
  34. labelD.setBounds(0,0,100,30);
  35.  
  36. text1 = new JTextField(" ");
  37. text1.setBounds(65,105, 200,50);
  38.  
  39.  
  40. button1=new JButton(" + ");
  41. button1.setBackground(Color.yellow);
  42. button1.setBounds(35,450,55,55);
  43.  
  44. button2=new JButton(" - ");
  45. button2.setBackground(Color.green);
  46. button2.setBounds(165,450,55,55);
  47.  
  48. button3=new JButton(" * ");
  49. button3.setBackground(Color.yellow);
  50. button3.setBounds(35,550,55,55);
  51.  
  52. button4=new JButton(" / ");
  53. button4.setBackground(Color.green);
  54. button4.setBounds(165,550,55,55);
  55.  
  56. panel.add(button1);
  57. panel.add(button2);
  58. panel.add(button3);
  59. panel.add(button4);
  60. panel.add(text1);
  61. panel.add(labelD);
  62. panel.setSize(500,700);
  63.  
  64. panel.setVisible(true);
  65. panel.setBackground(Color.BLACK);
  66. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  67. frame.setResizable(false);
  68.  
  69.  
  70.  
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement