图书管理系统 出现的问题

版权声明:原创文章欢迎转载,转载请注明出处 https://blog.csdn.net/w605283073/article/details/46572411

1

在主界面上侧单击右键  会弹出  右键菜单

但是在主界面中间 单击右键 没有反应

 

2

查找的时候

 


   JButton button_ok = new JButton("确定",new ImageIcon("ok.png"));
   southPanel.add(button_ok);
   button_ok.addActionListener(new ActionListener(){
   public void actionPerformed(ActionEvent e)
   {
    File f1 =SearchFrame.this.getClassName();
    
    File[] f = f1.listFiles();
    
    
    try {
     FileInputStream fr = new FileInputStream(f[0]);
     ObjectInputStream obo = new ObjectInputStream(fr);
     
      boolean exist = false;//用来判断有没有查到
     do{
      
      book_search =(Book)obo.readObject();
          System.out.println(book_search);
       if(book_search.toString().contains(textField.getText()))
       {
        exist =true;
        Object[][] book=new Object[1][];
       
            book[0][0]=book_search.getNumber();
          book[0][1]=book_search.getName();
          book[0][2]=book_search.getAuthor();
          book[0][3]=book_search.getPress();
          book[0][4]=book_search.getCount();
       
        String [] book_info = {"编号","书名 ","作者","出版社","数量"};
        table_search = new JTable(book,book_info);
       
       
                           new SearchResult();
       
       }
      
       
  

展开阅读全文

没有更多推荐了,返回首页