if (SwingUtilities.isRightMouseButton(event))
if (event.isPopupTrigger ())
   private void jbInit() throws Exception {      this.setTitle(LangTool.getString("spool.title"));      this.setIconImage(My5250.tnicon.getImage());      this.getContentPane().add(createFilterPanel(), BorderLayout.NORTH);      // get an instance of our table model      stm = new SpoolTableModel();      // create a table using our custom table model      spools = new JSortTable(stm);      TableColumn column = null;      for (int x = 0;x < stm.getColumnCount(); x++) {         column = spools.getColumnModel().getColumn(x);         column.setPreferredWidth(stm.getColumnPreferredSize(x));      }      spools.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);      // create our mouse listener on the table      spools.addMouseListener(new java.awt.event.MouseAdapter() {         public void mouseClicked(MouseEvent e) {            spools_mouseClicked(e);         }         public void mousePressed (MouseEvent event) {            if (SwingUtilities.isRightMouseButton(event))               showPopupMenu(event);         }         public void mouseReleased (MouseEvent event) {            if (SwingUtilities.isRightMouseButton(event))               showPopupMenu(event);         }      });      spools.setShowGrid(false);      //Create the scroll pane and add the table to it.      scrollPane = new JScrollPane(spools);      scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);      scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);      // setup the number of rows we should be working with      spools.setPreferredScrollableViewportSize(         new Dimension(            spools.getPreferredScrollableViewportSize().width,            spools.getFontMetrics(spools.getFont()).getHeight() * 8)      );      scrollPane.getViewport().setBackground(spools.getBackground());      scrollPane.setBackground(spools.getBackground());      //Setup our selection model listener      rowSM = spools.getSelectionModel();          rowSM.addListSelectionListener(new ListSelectionListener() {              public void valueChanged(ListSelectionEvent e) {                  //Ignore extra messages.                  if (e.getValueIsAdjusting())                     return;                  ListSelectionModel lsm =                      (ListSelectionModel)e.getSource();              }          });      rowSM.setSelectionMode(rowSM.SINGLE_SELECTION);      this.getContentPane().add(scrollPane, BorderLayout.CENTER);      status = new JLabel("0 " + LangTool.getString("spool.count"));      status.setBorder(BorderFactory.createEtchedBorder());      this.getContentPane().add(status, BorderLayout.SOUTH);      pack();      //Center the window      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();      Dimension frameSize = getSize();      if (frameSize.height > screenSize.height)         frameSize.height = screenSize.height;      if (frameSize.width > screenSize.width)         frameSize.width = screenSize.width;      setLocation((screenSize.width - frameSize.width) / 2,                     (screenSize.height - frameSize.height) / 2);      addWindowListener(new WindowAdapter() {         public void windowClosing(WindowEvent event) {            // close the spool file list//            if (splfList != null)//               splfList.close();            // close the system connection            if (system != null)               system.disconnectAllServices();            setVisible(false);            dispose();         }      });   }