Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. package lab9;
  2.  
  3.  
  4. import java.awt.BorderLayout;
  5. import java.awt.HeadlessException;
  6.  
  7. import javax.swing.ImageIcon;
  8. import javax.swing.JButton;
  9. import javax.swing.JFrame;
  10. import javax.swing.JLabel;
  11. import javax.swing.JTextField;
  12. import javax.swing.JToolBar;
  13.  
  14. import com.mysql.jdbc.Statement;
  15.  
  16. public class MyFrm extends JFrame{
  17.  
  18. private static final long serialVersionUID = 1L;
  19. private JToolBar tb = new JToolBar();
  20.  
  21.  
  22. private JButton firstButton = new JButton();
  23. private JButton previousButton = new JButton();
  24. private JTextField posText = new JTextField();
  25. private JButton nextButton = new JButton();
  26. private JButton lastButton = new JButton();
  27. private JButton addButton = new JButton();
  28. private JButton editButton = new JButton();
  29. private JButton deleteButton = new JButton();
  30. private JButton searchButton = new JButton();
  31. private JButton saveButton = new JButton();
  32. private JButton undoButton = new JButton();
  33.  
  34. private JLabel lbID= new JLabel("ID");
  35. private JLabel lblNume = new JLabel("Nume");
  36. private JLabel lblVarsta = new JLabel("Varsta");
  37.  
  38. private JTextField textId = new JTextField();
  39. private JTextField textNume = new JTextField();
  40. private JTextField textVarsta = new JTextField();
  41.  
  42. public JTextField getTextId() {
  43. return textId;
  44. }
  45. public void setTextId(JTextField textId) {
  46. this.textId = textId;
  47. }
  48. public JTextField getTextNume() {
  49. return textNume;
  50. }
  51. public void setTextNume(JTextField textNume) {
  52. this.textNume = textNume;
  53. }
  54. public JTextField getTextVarsta() {
  55. return textVarsta;
  56. }
  57. public void setTextVarsta(JTextField textVarsta) {
  58. this.textVarsta = textVarsta;
  59. }
  60.  
  61. public MyFrm(Statement sql) throws HeadlessException
  62. {
  63. super("Meniu");
  64.  
  65. getContentPane().setLayout(new BorderLayout());
  66.  
  67. setSize(450, 300);
  68. getContentPane().add(tb,BorderLayout.NORTH);
  69. setDefaultCloseOperation(EXIT_ON_CLOSE);
  70. setResizable(false);
  71. firstButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\MoveFirst.png"));
  72. tb.add(firstButton);
  73. previousButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\MovePrevious.png"));
  74. tb.add(previousButton);
  75. tb.add(posText);
  76. nextButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\MoveNext.png"));
  77. tb.add(nextButton);
  78. lastButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\MoveLast.png"));
  79. tb.add(lastButton);
  80. addButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\Add.png"));
  81. tb.add(addButton);
  82. editButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\Edit.png"));
  83. tb.add(editButton);
  84. deleteButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\Delete.png"));
  85. tb.add(deleteButton);
  86. searchButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\find.JPG"));
  87. tb.add(searchButton);
  88. saveButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\save.JPG"));
  89. tb.add(saveButton);
  90. undoButton.setIcon(new ImageIcon("C:\\Users\\student\\Downloads\\Imagini\\undo.JPG"));
  91. tb.add(undoButton);
  92.  
  93. }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement