Package javax.swing.table

Examples of javax.swing.table.JTableHeader


                    boolean ascending = (shiftPressed == 0);
                    sorter.sortByColumn(column, ascending);
                }
            }
        };
        JTableHeader th = tableView.getTableHeader();
        th.addMouseListener(listMouseListener);
    }
View Full Code Here


                    boolean ascending = (shiftPressed == 0);
                    sorter.sortByColumn(column, ascending);
                }
            }
        };
        JTableHeader th = tableView.getTableHeader();
        th.addMouseListener(listMouseListener);
    }
View Full Code Here

        south.add(m_progBar, BorderLayout.EAST);
        contentPane.add(south, BorderLayout.SOUTH);

        doSetTableCols();

        JTableHeader tableHeader = m_table.getTableHeader();
        tableHeader.setReorderingAllowed(true);
        tableHeader.setResizingAllowed(true);
        tableHeader.setForeground(Color.RED);

        doAddTableHeaderMenu();
        doAddTableMenu();
        doAddTableMouseListener();
        doInitTableCols();
View Full Code Here

        });
    }
   
    private void doAddTableHeaderMenu()
    {
        JTableHeader tableHeader = m_table.getTableHeader();
        tableHeader.addMouseListener(new MouseAdapter()
        {
            @Override
            public void mouseClicked(MouseEvent ev)
            {
                int button = ev.getButton();
View Full Code Here

    this.tableModel = tableModel;
  }
 
  public void mouseClicked(MouseEvent e) {
    if(tableModel.isSortable()){
          JTableHeader h = (JTableHeader) e.getSource();
          TableColumnModel columnModel = h.getColumnModel();
          int viewColumn = columnModel.getColumnIndexAtX(e.getX());
          int column = columnModel.getColumn(viewColumn).getModelIndex();
          if (column != -1 && column != SortablePdfSelectionTableModel.PASSWORD && column != SortablePdfSelectionTableModel.ROW_NUM) {
              int sortType = (tableModel.getSortingState().getCol() == column)?tableModel.getSortingState().getSortType(): SortablePdfSelectionTableModel.NOT_SORTED;
           
              // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
              // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
              sortType = sortType + (e.isShiftDown() ? -1 : 1);
              sortType = (sortType + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
              tableModel.setSortingState(tableModel.new SortingState(column, sortType));
              h.repaint();
          }
        }
    }
View Full Code Here

                        dataField.setAutoCreateRowSorter(true);
                        dataField.setGridColor(Color.GRAY);
                        dataField.setShowGrid(true);
                        dataField.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                        dataField.setRowSelectionAllowed(true);
                        dataField.setTableHeader(new JTableHeader(dataField.getColumnModel()));
                        dataField.setFont(new Font("Monospaced", dataField.getFont().getStyle(), dataField.getFont().getSize()));
                        dataField.setShowHorizontalLines(false);
//                        dataField.setIntercellSpacing(new Dimension(3, 5));

                        JDialog d = new JDialog(this.parent);
View Full Code Here

        table.setAutoCreateRowSorter(true);
        table.setGridColor(Color.GRAY);
        table.setShowGrid(true);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        table.setRowSelectionAllowed(true);
        table.setTableHeader(new JTableHeader(table.getColumnModel()));
        Util.setupColumnWidths(table.getColumnModel(), MAIN_COLS);
//        table.setFont(new Font("Monospaced", table.getFont().getStyle(), table.getFont().getSize()));
        table.getSelectionModel().addListSelectionListener(new RequestListSelectionListener(this, table, screenSize));

        add(new JScrollPane(table));
View Full Code Here

    jb_save.setName("jb_save");
    jb_save.addActionListener(this);
   
    logList=new JTable(this){
      protected JTableHeader createDefaultTableHeader() {
        return new JTableHeader(columnModel) {
          public String getToolTipText(MouseEvent e) {
            String tip = null;
            java.awt.Point p = e.getPoint();
            int index = columnModel.getColumnIndexAtX(p.x);
            int realIndex = columnModel.getColumn(index).getModelIndex();
View Full Code Here

    searchTable.setName("search");
    searchTable.setBackground(new Color(35, 35, 35));
    searchTable.setForeground(Color.GRAY);
    searchTable.setOpaque(true);

    final JTableHeader header = searchTable.getTableHeader();
    header.setOpaque(false);
    header.setBorder(BorderFactory.createRaisedSoftBevelBorder());
    header.setForeground(Color.GRAY);
    header.setAutoscrolls(true);

    header.setFont(new Font("Calibri", Font.PLAIN, 14));

    header.setBorder(BorderFactory.createEmptyBorder());

    searchTable.addKeyListener(new KeyAdapter() {
      @Override
      public void keyReleased(final KeyEvent e) {
        final int c = e.getKeyCode();
View Full Code Here

    table.setBackground(background);
    table.setForeground(Color.GRAY);
    table.setOpaque(true);

    final JTableHeader header = table.getTableHeader();
    header.setOpaque(false);
    header.setBorder(BorderFactory.createRaisedSoftBevelBorder());
    header.setForeground(Color.GRAY);
    header.setAutoscrolls(true);

    header.setFont(new Font("Calibri", Font.PLAIN, 14));

    header.setBorder(BorderFactory.createEmptyBorder());

    if (Settings.getLastPlayList().isEmpty()) {

      ModelUtils
      .loadPlayList(Constants.DATA_PATH + "scripts/blank.plist");
View Full Code Here

TOP

Related Classes of javax.swing.table.JTableHeader

Copyright © 2018 www.massapicom. 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.