Package javax.swing

Examples of javax.swing.JTable.addMouseListener()


        //Container that displays table showing items in cart
        tableModel = new TableModel( );
        JTable table = new JTable( tableModel );
        //handler removes item to shopping cart
        table.addMouseListener( new TableSelectionHandler( ) );
        ListSelectionModel tableSelectionModel = table.getSelectionModel( );
        tableSelectionModel
                           .setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
        TableColumnModel tableColumnModel = table.getColumnModel( );
        //notice we have a custom renderer for each column as both columns
View Full Code Here


            //Container that displays table showing items in cart
            tableModel = new TableModel();
            JTable table = new JTable( tableModel );
            //handler removes item to shopping cart
            table.addMouseListener( new TableSelectionHandler() );
            ListSelectionModel tableSelectionModel = table.getSelectionModel();
            tableSelectionModel.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
            TableColumnModel tableColumnModel = table.getColumnModel();
            //notice we have a custom renderer for each column as both columns
            // point to the same underlying object
View Full Code Here

            //Container that displays table showing items in cart
            tableModel = new TableModel();
            JTable table = new JTable( tableModel );
            //handler removes item to shopping cart
            table.addMouseListener( new TableSelectionHandler() );
            ListSelectionModel tableSelectionModel = table.getSelectionModel();
            tableSelectionModel.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
            TableColumnModel tableColumnModel = table.getColumnModel();
            //notice we have a custom renderer for each column as both columns
            // point to the same underlying object
View Full Code Here

            //Container that displays table showing items in cart
            tableModel = new TableModel();
            JTable table = new JTable( tableModel );
            //handler removes item to shopping cart
            table.addMouseListener( new TableSelectionHandler() );
            ListSelectionModel tableSelectionModel = table.getSelectionModel();
            tableSelectionModel.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
            TableColumnModel tableColumnModel = table.getColumnModel();
            //notice we have a custom renderer for each column as both columns
            // point to the same underlying object
View Full Code Here

    label.setVisible(false);

    /*
     * listeners
     */
    tbl.addMouseListener(new MouseAdapter() {
      @Override
      public void mousePressed(final MouseEvent me) {
        final JTable table = (JTable) me.getSource();
        final Point p = me.getPoint();
        final int row = table.rowAtPoint(p);
View Full Code Here

        } catch (ClassNotFoundException ex) {
        }
       
        ntcReasonTable.setRowSelectionAllowed(false);
        ntcReasonTable.setName("ntcReasonTable");
        ntcReasonTable.addMouseListener(new TableMouseListener(ntcReasonTable));

        nstackTrace.setRows(5);
       
        // add runTabbed panel
        JSplitPane resultMainpanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
View Full Code Here

      JScrollPane scrollPane = new JScrollPane(table);
      this.componentTabbedPane.add(scrollPane, 1);
      this.componentTabbedPane.setTitleAt(1, "Streams");
      table.getColumnModel().getColumn(0).setMaxWidth(20);
      this.componentTabbedPane.setSelectedIndex(1);
      table.addMouseListener(new MouseAdapter() {

        private void maybeShowPopup(MouseEvent e) {
          if (e.isPopupTrigger() && table.isEnabled()) {
            Point p = new Point(e.getX(), e.getY());
            int col = table.columnAtPoint(p);
View Full Code Here

      tableSorter.clearComparator();
      tableSorter.appendComparator(initialSortColumn, 0, false);
    }

    // Add the context menu listener
    table.addMouseListener(new ContextPopupMenuListener());

    // Add our mouse handlers to setup our desired selection mechanics
    table.addMouseListener(new DoubleClickListener());

    // Keep our status line up to date with the selections and filtering
View Full Code Here

    // Add the context menu listener
    table.addMouseListener(new ContextPopupMenuListener());

    // Add our mouse handlers to setup our desired selection mechanics
    table.addMouseListener(new DoubleClickListener());

    // Keep our status line up to date with the selections and filtering
    StatusBarUpdateListener statusBarUpdateListener = new StatusBarUpdateListener();
    table.getSelectionModel().addListSelectionListener(statusBarUpdateListener);
    getFinalEventList().addListEventListener(statusBarUpdateListener);
View Full Code Here

    valuesCol.setCellRenderer(cellRenderer);
    TableColumn envReplaceCol = table.getColumnModel().getColumn(3);
    envReplaceCol.setPreferredWidth(75);
    envReplaceCol.setCellRenderer(cellRenderer);

    table.addMouseListener(new MouseListener() {
      public void mouseClicked(MouseEvent e) {
        if (e.getButton() == MouseEvent.BUTTON3
            && DefaultPropView.this.table.getSelectedRow() != -1) {
          int row = DefaultPropView.this.table.getSelectedRow();// rowAtPoint(DefaultPropView.this.table.getMousePosition());
          String key = getKey(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.