Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. package lab7;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.FlowLayout;
  5. import java.awt.Frame;
  6. import java.awt.Label;
  7. import java.awt.MouseInfo;
  8. import java.awt.Point;
  9. import java.awt.PointerInfo;
  10. import java.awt.event.MouseEvent;
  11. import java.awt.event.MouseMotionListener;
  12. import java.awt.event.WindowAdapter;
  13. import java.awt.event.WindowEvent;
  14.  
  15. import javax.swing.JButton;
  16. import javax.swing.JFrame;
  17. import javax.swing.JLabel;
  18. import javax.swing.JTextField;
  19. import javax.swing.border.Border;
  20.  
  21. public class DatabaseViewer extends Frame
  22. {
  23.  
  24. public JFrame f;
  25. public Label j;
  26. public JButton b;
  27. public JButton b1;
  28. public JTextField t1;
  29.  
  30. public void initComponents()
  31. {
  32.  
  33. f = new JFrame("Button Example");
  34.  
  35.  
  36. b = new JButton("Wyczysc");
  37. b.setBounds(0, 50, 100, 600);
  38. b1 = new JButton("Wykonaj");
  39. b1.setBounds(690, 50, 100, 600);
  40.  
  41. t1 = new JTextField(20);
  42. t1.setBounds(100, 50, 590, 600);
  43.  
  44. j=new Label();
  45. j.setBounds(20,40,100,20);
  46. add(j);
  47.  
  48.  
  49.  
  50.  
  51.  
  52. f.add(b1);
  53. f.add(b);
  54. f.add(t1);
  55.  
  56. f.setSize(800, 600);
  57. f.setLayout(null);
  58. f.setVisible(true);
  59.  
  60. }
  61.  
  62.  
  63.  
  64. public static void main(String[] args)
  65. {
  66. DatabaseViewer b = new DatabaseViewer();
  67. b.initComponents();
  68.  
  69. // java.awt.EventQueue.invokeLater(new Runnable()
  70. // {
  71. // @Override
  72. // public void run()
  73. // {
  74. // b.initComponents();
  75. // new DatabaseViewer().setVisible(true);
  76. // }
  77. // });
  78.  
  79. }
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement