Advertisement
Guest User

Untitled

a guest
May 24th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.69 KB | None | 0 0
  1. import java.awt.EventQueue;
  2.  
  3. import javax.swing.ButtonGroup;
  4. import javax.swing.JFrame;
  5. import javax.swing.JLabel;
  6. import javax.swing.JOptionPane;
  7. import javax.swing.JRadioButton;
  8. import javax.swing.JTabbedPane;
  9. import javax.swing.JTable;
  10. import javax.swing.JTextField;
  11. import javax.swing.JPasswordField;
  12. import javax.swing.JMenuBar;
  13. import javax.swing.JButton;
  14. import java.awt.event.ActionListener;
  15. import java.awt.event.ActionEvent;
  16. import java.awt.CardLayout;
  17. import java.awt.Color;
  18. import java.awt.Font;
  19. import java.awt.SystemColor;
  20. import org.eclipse.wb.swing.FocusTraversalOnArray;
  21. import java.awt.Component;
  22. import javax.swing.JPanel;
  23. import javax.swing.border.BevelBorder;
  24. import javax.swing.DropMode;
  25. import javax.swing.JToggleButton;
  26. import javax.swing.JComboBox;
  27. import javax.swing.border.TitledBorder;
  28. import javax.swing.UIManager;
  29. import javax.swing.border.LineBorder;
  30. import javax.swing.border.CompoundBorder;
  31. import javax.swing.table.DefaultTableModel;
  32. import javax.swing.JTextPane;
  33. import javax.swing.JScrollPane;
  34.  
  35. public class Database {
  36.  
  37. private JFrame frame;
  38. private JFrame frame1;
  39. private JTextField textField;
  40. private JPasswordField passwordField;
  41. private JPanel panel;
  42. private CardLayout card;
  43. private JTextField textField_1;
  44. private JTextField textField_3;
  45. private JTextField textField_4;
  46. private JPasswordField passwordField_1;
  47. private JTextField textField_2;
  48. private JTextField textField_5;
  49. private JTextField textField_6;
  50. private JTextField textField_7;
  51. private JTextField textField_8;
  52. private JTextField textField_9;
  53. private JTextField textField_10;
  54. private JTextField textField_11;
  55. private JTextField textField_12;
  56. private JTextPane authorList;
  57. void publisherData(){
  58. String publisher = textField_8.getText();
  59. if(publisher==""){
  60. //messege insert publisher name
  61. JTextField name= new JTextField();
  62. int option = JOptionPane.showConfirmDialog(null, name,
  63. "Publisher name", JOptionPane.OK_CANCEL_OPTION);
  64. if (option == JOptionPane.OK_OPTION) {
  65.  
  66. }
  67. }else{
  68.  
  69. String url = "jdbc:mysql://localhost:3306/";
  70. String user = "root";
  71. String password = "";
  72. try{
  73. /* Class.forName("com.mysql.jdbc.Driver").newInstance();
  74. Connection con = DriverManager.getConnection(url, user, password);
  75. Statement stt = con.createStatement();
  76. stt.execute("USE book_store");
  77. ResultSet res = stt.executeQuery("SELECT * FROM book WHERE lname = '"+publisher+"'");*/
  78. // if(!res.next()){
  79. JTextField address = new JTextField();
  80. JTextField phone= new JTextField();
  81. Object[] message = { "address:", address, "phone:", phone };
  82.  
  83. int option = JOptionPane.showConfirmDialog(null, message,
  84. "Publisher", JOptionPane.OK_CANCEL_OPTION);
  85. if (option == JOptionPane.OK_OPTION) {
  86.  
  87. }
  88. // }
  89. }catch(Exception e){
  90.  
  91. }
  92. }
  93. }
  94. /**
  95. * Launch the application.
  96. */
  97. public static void main(String[] args) {
  98. EventQueue.invokeLater(new Runnable() {
  99. public void run() {
  100. try {
  101. Database window = new Database();
  102. window.frame.setVisible(true);
  103. } catch (Exception e) {
  104. e.printStackTrace();
  105. }
  106. }
  107. });
  108. }
  109.  
  110. /**
  111. * Create the application.
  112. */
  113. public Database() {
  114. initialize();
  115. }
  116.  
  117. /**
  118. * Initialize the contents of the frame.
  119. */
  120. private void initialize() {
  121. frame = new JFrame();
  122. frame.getContentPane().setForeground(SystemColor.activeCaption);
  123. frame.getContentPane().setBackground(Color.LIGHT_GRAY);
  124. frame.getContentPane().setFont(new Font("Tahoma", Font.BOLD, 13));
  125. frame.setBounds(100, 100, 541, 476);
  126. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  127. frame.getContentPane().setLayout(null);
  128. /*
  129. * frame1=new JFrame();
  130. * frame1.getContentPane().setForeground(SystemColor.activeCaption);
  131. * frame1.getContentPane().setBackground(Color.LIGHT_GRAY);
  132. * frame1.getContentPane().setFont(new Font("Tahoma", Font.BOLD, 13));
  133. * frame1.setBounds(100, 100, 450, 476);
  134. * frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  135. * frame1.getContentPane().setLayout(null);
  136. */
  137. panel = new JPanel();
  138. panel.setBounds(0, 0, 544, 430);
  139. frame.getContentPane().add(panel);
  140. card = new CardLayout(0, 0);
  141. panel.setLayout(card);
  142.  
  143. JPanel panel_1 = new JPanel();
  144. panel_1.setBounds(0, 0, 544, 430);
  145. panel.add(panel_1, "first");
  146. panel_1.setLayout(null);
  147.  
  148. textField = new JTextField();
  149. textField.setBounds(154, 163, 126, 20);
  150. panel_1.add(textField);
  151. textField.setColumns(10);
  152.  
  153. JLabel lblUsername = new JLabel("Username");
  154. lblUsername.setBounds(64, 166, 75, 14);
  155. lblUsername.setFont(new Font("Tahoma", Font.BOLD, 13));
  156. lblUsername.setBackground(Color.BLUE);
  157. panel_1.add(lblUsername);
  158.  
  159. JLabel lblPassword = new JLabel("Password");
  160. lblPassword.setBounds(64, 197, 69, 14);
  161. lblPassword.setFont(new Font("Tahoma", Font.BOLD, 13));
  162. panel_1.add(lblPassword);
  163.  
  164. passwordField = new JPasswordField();
  165. passwordField.setBounds(154, 194, 126, 20);
  166. panel_1.add(passwordField);
  167.  
  168. JButton btnLogin = new JButton("login");
  169. btnLogin.setBounds(154, 249, 89, 23);
  170.  
  171. btnLogin.setBackground(Color.ORANGE);
  172. panel_1.add(btnLogin);
  173.  
  174. final JPanel panel_2 = new JPanel();
  175. panel_2.setBounds(318, 58, 89, 23);
  176. panel_1.add(panel_2, "second");
  177. panel_2.setLayout(null);
  178.  
  179. JButton btnSignUp = new JButton("sign up");
  180.  
  181. btnSignUp.setBounds(0, 0, 89, 23);
  182. panel_2.add(btnSignUp);
  183. btnSignUp.setFont(new Font("Tahoma", Font.BOLD, 13));
  184. btnSignUp.setBackground(Color.WHITE);
  185.  
  186. JPanel panel_3 = new JPanel();
  187. panel_3.setBorder(new BevelBorder(BevelBorder.LOWERED, new Color(255,
  188. 0, 0), Color.RED, Color.RED, Color.RED));
  189. panel_3.setBounds(36, 107, 331, 215);
  190. panel_1.add(panel_3, "third");
  191. panel_3.setLayout(null);
  192.  
  193. JLabel lblNewLabel = new JLabel("Login");
  194. lblNewLabel.setBounds(149, 24, 46, 14);
  195. panel_3.add(lblNewLabel);
  196.  
  197. JLabel errorMsg = new JLabel("");
  198. errorMsg.setBounds(85, 117, 197, 14);
  199. panel_3.add(errorMsg);
  200.  
  201. panel.setFocusTraversalPolicy(new FocusTraversalOnArray(
  202. new Component[] { textField, lblUsername, lblPassword,
  203. passwordField, btnLogin, btnSignUp }));
  204. JPanel panel_4 = new JPanel();
  205. panel_4.setBackground(Color.WHITE);
  206. panel_4.setBounds(0, 0, 544, 430);
  207. panel.add(panel_4, "fourth");
  208. panel_4.setLayout(null);
  209.  
  210. JLabel lblSignUp = new JLabel("Sign up");
  211. lblSignUp.setFont(new Font("Tahoma", Font.BOLD, 14));
  212. lblSignUp.setBounds(188, 54, 102, 31);
  213. panel_4.add(lblSignUp);
  214.  
  215. textField_1 = new JTextField();
  216. textField_1.setBounds(150, 122, 154, 20);
  217. panel_4.add(textField_1);
  218. textField_1.setColumns(10);
  219.  
  220. textField_3 = new JTextField();
  221. textField_3.setBounds(150, 240, 154, 20);
  222. panel_4.add(textField_3);
  223. textField_3.setColumns(10);
  224.  
  225. textField_4 = new JTextField();
  226. textField_4.setBounds(150, 300, 154, 20);
  227. panel_4.add(textField_4);
  228. textField_4.setColumns(10);
  229.  
  230. JLabel lblUsername_1 = new JLabel("Username");
  231. lblUsername_1.setBounds(35, 128, 105, 14);
  232. panel_4.add(lblUsername_1);
  233.  
  234. passwordField_1 = new JPasswordField();
  235. passwordField_1.setBounds(150, 179, 154, 20);
  236. panel_4.add(passwordField_1);
  237.  
  238. JLabel lblPassword_1 = new JLabel("Password");
  239. lblPassword_1.setBounds(35, 185, 105, 14);
  240. panel_4.add(lblPassword_1);
  241.  
  242. JLabel lblFirstName = new JLabel("First Name");
  243. lblFirstName.setBounds(35, 246, 105, 14);
  244. panel_4.add(lblFirstName);
  245.  
  246. JLabel lblNewLabel_1 = new JLabel("Last Name");
  247. lblNewLabel_1.setBounds(35, 306, 105, 14);
  248. panel_4.add(lblNewLabel_1);
  249.  
  250. JButton btnSubmit = new JButton("Register");
  251. btnSubmit.setBounds(178, 372, 89, 23);
  252. panel_4.add(btnSubmit);
  253.  
  254. JButton btnNewButton = new JButton("Back");
  255. btnNewButton.addActionListener(new ActionListener() {
  256. public void actionPerformed(ActionEvent arg0) {
  257. card.show(panel, "first");
  258.  
  259. }
  260. });
  261. btnNewButton.setBounds(10, 11, 89, 23);
  262. panel_4.add(btnNewButton);
  263.  
  264. JLabel usernameMsg = new JLabel("");
  265. usernameMsg.setBounds(150, 151, 236, 14);
  266. panel_4.add(usernameMsg);
  267.  
  268. JLabel passwordMsg = new JLabel("");
  269. passwordMsg.setBounds(150, 215, 236, 14);
  270. panel_4.add(passwordMsg);
  271.  
  272. JLabel firstnameMsg = new JLabel("");
  273. firstnameMsg.setBounds(150, 275, 236, 14);
  274. panel_4.add(firstnameMsg);
  275.  
  276. JLabel lastnameMsg = new JLabel("");
  277. lastnameMsg.setBounds(150, 331, 291, 14);
  278. panel_4.add(lastnameMsg);
  279. btnSignUp.addActionListener(new ActionListener() {
  280. public void actionPerformed(ActionEvent e) {
  281. card.show(panel, "fourth");
  282. }
  283. });
  284.  
  285. // *************************operations***************************
  286.  
  287. JPanel panel_5 = new JPanel();
  288. panel_5.setBackground(Color.CYAN);
  289. panel_5.setBounds(0, 0, 424, 419);
  290. panel.add(panel_5, "operations");
  291. panel_5.setLayout(null);
  292.  
  293. JPanel panel_7 = new JPanel();
  294. panel_7.setBackground(Color.BLUE);
  295. panel_7.setBorder(new LineBorder(new Color(0, 0, 0), 4));
  296. panel_7.setBounds(125, 92, 137, 254);
  297. panel_5.add(panel_7);
  298. panel_7.setLayout(null);
  299.  
  300. JButton btnNewButton1 = new JButton("add book");
  301. btnNewButton1.addActionListener(new ActionListener() {
  302. public void actionPerformed(ActionEvent e) {
  303. card.show(panel, "addbooks");
  304. }
  305. });
  306. btnNewButton1.setBounds(6, 16, 125, 23);
  307. panel_7.add(btnNewButton1);
  308.  
  309. JButton btnNewButton_1 = new JButton("update");
  310. btnNewButton_1.addActionListener(new ActionListener() {
  311. public void actionPerformed(ActionEvent e) {
  312. card.show(panel, "search/update");
  313. }
  314. });
  315. btnNewButton_1.setBounds(6, 86, 125, 23);
  316. panel_7.add(btnNewButton_1);
  317.  
  318. JButton btnNewButton_2 = new JButton("confirm order");
  319. btnNewButton_2.addActionListener(new ActionListener() {
  320. public void actionPerformed(ActionEvent e) {
  321. card.show(panel, "confirmOrders");
  322. }
  323. });
  324. btnNewButton_2.setBounds(6, 148, 125, 23);
  325. panel_7.add(btnNewButton_2);
  326.  
  327. JButton btnNewButton_3 = new JButton("search");
  328. btnNewButton_3.addActionListener(new ActionListener() {
  329. public void actionPerformed(ActionEvent e) {
  330. card.show(panel, "search/update");
  331. }
  332. });
  333. btnNewButton_3.setBounds(6, 216, 125, 23);
  334. panel_7.add(btnNewButton_3);
  335.  
  336. JLabel lblUsersOperations = new JLabel(
  337. " Users operations");
  338. lblUsersOperations.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC,
  339. 14));
  340. lblUsersOperations.setBounds(45, 50, 363, 39);
  341. panel_5.add(lblUsersOperations);
  342.  
  343. JLabel lblNewLabel_2 = new JLabel("New label");
  344. lblNewLabel_2.setBounds(10, 11, 150, 28);
  345. panel_5.add(lblNewLabel_2);
  346.  
  347. JButton btnLogout = new JButton("logout");
  348. btnLogout.addActionListener(new ActionListener() {
  349. public void actionPerformed(ActionEvent e) {
  350. card.show(panel, "first");
  351. }
  352. });
  353. btnLogout.setBounds(319, 14, 89, 23);
  354. panel_5.add(btnLogout);
  355.  
  356. JPanel panel_8 = new JPanel();
  357. panel_8.setBounds(50, 50, 10, 10);
  358. panel.add(panel_8, "confirmOrders");
  359. panel_8.setLayout(null);
  360.  
  361. JButton btnNewButton_4 = new JButton("Back");
  362. btnNewButton_4.addActionListener(new ActionListener() {
  363. public void actionPerformed(ActionEvent e) {
  364. card.show(panel, "operations");
  365. }
  366. });
  367. btnNewButton_4.setBounds(10, 11, 89, 23);
  368. panel_8.add(btnNewButton_4);
  369.  
  370. textField_2 = new JTextField();
  371. textField_2.setBounds(162, 138, 138, 20);
  372. panel_8.add(textField_2);
  373. textField_2.setColumns(10);
  374.  
  375. JLabel lblNewLabel_3 = new JLabel("Enter ISBN");
  376. lblNewLabel_3.setBounds(38, 141, 114, 14);
  377. panel_8.add(lblNewLabel_3);
  378.  
  379. JLabel lblNewLabel_4 = new JLabel("Confirm Order");
  380. lblNewLabel_4.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 13));
  381. lblNewLabel_4.setBounds(177, 73, 156, 14);
  382. panel_8.add(lblNewLabel_4);
  383.  
  384. JButton btnNewButton_5 = new JButton("Confirm");
  385. btnNewButton_5.setBounds(177, 207, 89, 23);
  386. panel_8.add(btnNewButton_5);
  387.  
  388. JLabel msg = new JLabel("");
  389. msg.setBounds(96, 303, 304, 14);
  390. panel_8.add(msg);
  391. panel_5.setLayout(null);
  392.  
  393. JPanel panel_9 = new JPanel();
  394. panel_9.setBounds(55, 92, 10, 10);
  395. panel.add(panel_9, "addbooks");
  396. panel_9.setLayout(null);
  397.  
  398. JButton btnNewButton_6 = new JButton("Back");
  399. btnNewButton_6.addActionListener(new ActionListener() {
  400. public void actionPerformed(ActionEvent e) {
  401. card.show(panel, "operations");
  402. }
  403. });
  404. btnNewButton_6.setBounds(0, 11, 89, 23);
  405. panel_9.add(btnNewButton_6);
  406.  
  407. textField_5 = new JTextField();
  408. textField_5.setBounds(238, 258, 170, 20);
  409. panel_9.add(textField_5);
  410. textField_5.setColumns(10);
  411.  
  412. textField_6 = new JTextField();
  413. textField_6.setBounds(21, 92, 170, 20);
  414. panel_9.add(textField_6);
  415. textField_6.setColumns(10);
  416.  
  417. JLabel lblNewLabel_5 = new JLabel("");
  418. lblNewLabel_5.setForeground(Color.RED);
  419. lblNewLabel_5.setBackground(Color.WHITE);
  420. lblNewLabel_5.setBounds(347, 58, 127, 14);
  421. panel_9.add(lblNewLabel_5);
  422.  
  423. textField_7 = new JTextField();
  424. textField_7.setBounds(238, 92, 170, 20);
  425. panel_9.add(textField_7);
  426. textField_7.setColumns(10);
  427.  
  428. textField_8 = new JTextField();
  429. textField_8.setBounds(21, 148, 170, 20);
  430. panel_9.add(textField_8);
  431. textField_8.setColumns(10);
  432.  
  433. textField_9 = new JTextField();
  434. textField_9.setBounds(238, 148, 170, 20);
  435. panel_9.add(textField_9);
  436. textField_9.setColumns(10);
  437.  
  438. textField_10 = new JTextField();
  439. textField_10.setBounds(21, 202, 170, 20);
  440. panel_9.add(textField_10);
  441. textField_10.setColumns(10);
  442.  
  443. textField_11 = new JTextField();
  444. textField_11.setBounds(238, 202, 170, 20);
  445. panel_9.add(textField_11);
  446. textField_11.setColumns(10);
  447.  
  448. textField_12 = new JTextField();
  449. textField_12.setBounds(21, 258, 170, 20);
  450. panel_9.add(textField_12);
  451. textField_12.setColumns(10);
  452.  
  453. JLabel lblNewLabel_6 = new JLabel("Insert Book");
  454. lblNewLabel_6.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 14));
  455. lblNewLabel_6.setBounds(216, 40, 176, 14);
  456. panel_9.add(lblNewLabel_6);
  457.  
  458. JLabel lblNewLabel_7 = new JLabel("Enter ISBN");
  459. lblNewLabel_7.setBounds(28, 67, 114, 14);
  460. panel_9.add(lblNewLabel_7);
  461.  
  462. JLabel lblNewLabel_8 = new JLabel("Title");
  463. lblNewLabel_8.setBounds(274, 67, 79, 14);
  464. panel_9.add(lblNewLabel_8);
  465.  
  466. JLabel lblNewLabel_9 = new JLabel("Publisher");
  467. lblNewLabel_9.setBounds(31, 121, 114, 14);
  468. panel_9.add(lblNewLabel_9);
  469.  
  470. JLabel lblNewLabel_10 = new JLabel("Publication year");
  471. lblNewLabel_10.setBounds(274, 123, 147, 14);
  472. panel_9.add(lblNewLabel_10);
  473.  
  474. JLabel lblNewLabel_11 = new JLabel("Selling price");
  475. lblNewLabel_11.setBounds(31, 177, 114, 14);
  476. panel_9.add(lblNewLabel_11);
  477.  
  478. JLabel lblNewLabel_12 = new JLabel("Category");
  479. lblNewLabel_12.setBounds(274, 179, 114, 14);
  480. panel_9.add(lblNewLabel_12);
  481.  
  482. JLabel lblNewLabel_13 = new JLabel("Copies");
  483. lblNewLabel_13.setBounds(31, 233, 79, 14);
  484. panel_9.add(lblNewLabel_13);
  485.  
  486. JLabel lblNewLabel_14 = new JLabel("Threshold");
  487. lblNewLabel_14.setBounds(271, 233, 102, 14);
  488. panel_9.add(lblNewLabel_14);
  489.  
  490. JButton btnNewButton_7 = new JButton("Insert");
  491. btnNewButton_7.addActionListener(new ActionListener() {
  492. public void actionPerformed(ActionEvent e) {
  493. publisherData() ;
  494. }
  495. });
  496. btnNewButton_7.setBounds(200, 384, 89, 23);
  497. panel_9.add(btnNewButton_7);
  498. authorList = new JTextPane();
  499. authorList.setEditable(false);
  500. JScrollPane scrollPane = new JScrollPane();
  501. scrollPane.setBounds(21, 312, 429, 71);
  502. panel_9.add(scrollPane);
  503. scrollPane.setViewportView(authorList);
  504. JButton btnNewButton_9 = new JButton("insert author");
  505. btnNewButton_9.addActionListener(new ActionListener() {
  506. public void actionPerformed(ActionEvent e) {
  507. JTextField author = new JTextField();
  508. int option = JOptionPane.showConfirmDialog(null, author,
  509. "search", JOptionPane.OK_CANCEL_OPTION);
  510. if (option == JOptionPane.OK_OPTION
  511. && !author.getText().equals("")) {
  512. if (!authorList.getText().equals(""))
  513. authorList.setText(authorList.getText() + "\n"
  514. + author.getText());
  515. else
  516. authorList.setText(author.getText());
  517. }
  518.  
  519. }
  520. });
  521. btnNewButton_9.setBounds(168, 285, 121, 23);
  522. panel_9.add(btnNewButton_9);
  523.  
  524. JPanel panel_6 = new JPanel();
  525. panel_6.setBounds(0, 0, 432, 419);
  526. panel.add(panel_6, "search/update");
  527. btnLogin.addActionListener(new ActionListener() {
  528. public void actionPerformed(ActionEvent arg0) {
  529. card.show(panel, "operations");
  530. }
  531. });
  532. panel_6.setLayout(null);
  533.  
  534. JLabel lblSearchBy = new JLabel("search by");
  535. lblSearchBy.setBounds(10, 39, 65, 14);
  536. panel_6.add(lblSearchBy);
  537.  
  538. JRadioButton rdbtnIsbnAndTiltle = new JRadioButton("ISBN and Tiltle");
  539. rdbtnIsbnAndTiltle.addActionListener(new ActionListener() {
  540. public void actionPerformed(ActionEvent e) {
  541.  
  542. JTextField ISBN = new JTextField();
  543. JTextField Title = new JTextField();
  544. Object[] message = { "ISBN:", ISBN, "Title:", Title };
  545.  
  546. int option = JOptionPane.showConfirmDialog(null, message,
  547. "search", JOptionPane.OK_CANCEL_OPTION);
  548. if (option == JOptionPane.OK_OPTION) {
  549.  
  550. }
  551. }
  552. });
  553. rdbtnIsbnAndTiltle.setBounds(66, 35, 115, 23);
  554. panel_6.add(rdbtnIsbnAndTiltle);
  555.  
  556. JRadioButton rdbtnCategory = new JRadioButton("Category");
  557. rdbtnCategory.addActionListener(new ActionListener() {
  558. public void actionPerformed(ActionEvent arg0) {
  559. JTextField catg = new JTextField();
  560. int option = JOptionPane.showConfirmDialog(null, catg,
  561. "search", JOptionPane.OK_CANCEL_OPTION);
  562. if (option == JOptionPane.OK_OPTION) {
  563.  
  564. }
  565. }
  566. });
  567. rdbtnCategory.setBounds(178, 35, 83, 23);
  568. panel_6.add(rdbtnCategory);
  569.  
  570. JRadioButton rdbtnAuthor = new JRadioButton("author");
  571. rdbtnAuthor.addActionListener(new ActionListener() {
  572. public void actionPerformed(ActionEvent arg0) {
  573. JTextField author = new JTextField();
  574. int option = JOptionPane.showConfirmDialog(null, author,
  575. "search", JOptionPane.OK_CANCEL_OPTION);
  576. if (option == JOptionPane.OK_OPTION) {
  577.  
  578. }
  579. }
  580. });
  581. rdbtnAuthor.setBounds(257, 35, 65, 23);
  582. panel_6.add(rdbtnAuthor);
  583.  
  584. JRadioButton rdbtnPublisher = new JRadioButton("publisher");
  585. rdbtnPublisher.addActionListener(new ActionListener() {
  586. public void actionPerformed(ActionEvent arg0) {
  587. JTextField author = new JTextField();
  588. int option = JOptionPane.showConfirmDialog(null, author,
  589. "search", JOptionPane.OK_CANCEL_OPTION);
  590. if (option == JOptionPane.OK_OPTION) {
  591.  
  592. }
  593. }
  594. });
  595. rdbtnPublisher.setBounds(324, 35, 94, 23);
  596. panel_6.add(rdbtnPublisher);
  597.  
  598. JRadioButton rdbtnCopies = new JRadioButton("copies");
  599. rdbtnCopies.addActionListener(new ActionListener() {
  600. public void actionPerformed(ActionEvent arg0) {
  601. JTextField copy = new JTextField();
  602. int option = JOptionPane.showConfirmDialog(null, copy,
  603. "search", JOptionPane.OK_CANCEL_OPTION);
  604. if (option == JOptionPane.OK_OPTION) {
  605.  
  606. }
  607. }
  608. });
  609. rdbtnCopies.setBounds(414, 35, 77, 23);
  610. panel_6.add(rdbtnCopies);
  611.  
  612. ButtonGroup group = new ButtonGroup();
  613. group.add(rdbtnIsbnAndTiltle);
  614. group.add(rdbtnCategory);
  615. group.add(rdbtnAuthor);
  616. group.add(rdbtnPublisher);
  617. group.add(rdbtnCopies);
  618.  
  619. JButton btnNewButton_41 = new JButton("Update");
  620. btnNewButton_41.addActionListener(new ActionListener() {
  621. public void actionPerformed(ActionEvent arg0) {
  622. // check search al 2wl
  623. // lma y3ml
  624. JTextField update = new JTextField();
  625. int option = JOptionPane.showConfirmDialog(null, update,
  626. "update", JOptionPane.OK_CANCEL_OPTION);
  627. if (option == JOptionPane.OK_OPTION) {
  628.  
  629. }
  630. }
  631. });
  632. btnNewButton_41.setBounds(182, 72, 94, 23);
  633. panel_6.add(btnNewButton_41);
  634.  
  635. btnLogin.addActionListener(new ActionListener() {
  636. public void actionPerformed(ActionEvent arg0) {
  637. card.show(panel, "operations");
  638. }
  639. });
  640.  
  641. JButton btnNewButton_8 = new JButton("back");
  642. btnNewButton_8.addActionListener(new ActionListener() {
  643. public void actionPerformed(ActionEvent arg0) {
  644. card.show(panel, "operations");
  645. }
  646. });
  647. btnNewButton_8.setBounds(0, 5, 89, 23);
  648. panel_6.add(btnNewButton_8);
  649.  
  650. JTable table = new JTable();
  651. table.setModel(new DefaultTableModel(new Object[][] {
  652. { "ISBN", "Title", "Publisher", "Year", "Price", "Categ",
  653. "#Copy", "Threshold" },
  654. { null, null, null, null, null, null, null, null },
  655. { null, null, null, null, null, null, null, null },
  656. { null, null, null, null, null, null, null, null },
  657. { null, null, null, null, null, null, null, null },
  658. { null, null, null, null, null, null, null, null },
  659. { null, null, null, null, null, null, null, null },
  660. { null, null, null, null, null, null, null, null },
  661. { null, null, null, null, null, null, null, null },
  662. { null, null, null, null, null, null, null, null },
  663. { null, null, null, null, null, null, null, null },
  664. { null, null, null, null, null, null, null, null },
  665. { null, null, null, null, null, null, null, null },
  666. { null, null, null, null, null, null, null, null },
  667. { null, null, null, null, null, null, null, null },
  668. { null, null, null, null, null, null, null, null },
  669. { null, null, null, null, null, null, null, null },
  670. { null, null, null, null, null, null, null, null },
  671. { null, null, null, null, null, null, null, null },
  672. { null, null, null, null, null, null, null, null }, },
  673. new String[] { "ISBN", "Title", "Publisher", "Year", "Price",
  674. "Categ", "#Copy", "Threshold" }) {
  675. boolean[] columnEditables = new boolean[] { false, false, false,
  676. false, false, false, false, false };
  677.  
  678. public boolean isCellEditable(int row, int column) {
  679. return columnEditables[column];
  680. }
  681. });
  682.  
  683. table.setBounds(10, 99, 512, 320);
  684.  
  685. panel_6.add(table);
  686.  
  687. }
  688. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement