Package javax.swing

Examples of javax.swing.JTable$DateTableCellRenderer


   *  
   * @return javax.swing.JTable 
   */
  private JTable getJTable() {
    if(jTable == null) {
      jTable = new JTable();
      jTable.setModel(getJTableModel());
      jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

      Vector v;
      int taille = playlist.size();
View Full Code Here


        predecessorsPanel = new JPanel(new GridBagLayout());

        myTableModel = new DependencyTableModel(getTask());

        predecessorsTable = new JTable(myTableModel);

        predecessorsTable.setPreferredScrollableViewportSize(new Dimension(500,
                130));

        setUpPredecessorComboColumn(predecessorsTable.getColumnModel()
View Full Code Here

                    rowData[ i ] [ 2 ] = "";
                }

            }

            JTable table = new JTable(rowData, colName);
            table.getColumnModel().getColumn(2).setCellRenderer( sampleRenderer );
            table.getColumnModel().getColumn(0).setPreferredWidth(250);
            table.getColumnModel().getColumn(1).setPreferredWidth(500);
            table.getColumnModel().getColumn(2).setPreferredWidth(50);

            pane.addTab( component, new JScrollPane( table ) );
        }
    }
View Full Code Here

        messageBodyScrollPane = new JScrollPane(messageTextArea);
        messageBodyScrollPane.setWheelScrollingEnabled(true);

        // build attached files scroll pane
        attachedFilesModel = new AttachedFilesTableModel();
        filesTable = new JTable(attachedFilesModel);
        attachedFilesModel.configureTable(filesTable);
        filesTableScrollPane = new JScrollPane(filesTable);
        filesTableScrollPane.setWheelScrollingEnabled(true);

        // build attached boards scroll pane
        attachedBoardsModel = new AttachedBoardTableModel();
        boardsTable = new JTable(attachedBoardsModel) {
            DescColumnRenderer descColRenderer = new DescColumnRenderer();
            @Override
            public TableCellRenderer getCellRenderer(final int row, final int column) {
                if( column == 2 ) {
                    return descColRenderer;
View Full Code Here

      tableModel = new TagEditorTableModel(this);

      //Creates the right treetable, with the above model, turn off
      // autoresize and sets Table selection listeners
      tableSorter = new TableSorter(tableModel); //Provides sorting capabilities
      table = new JTable();
      table.setModel(tableSorter);
      table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
      tableSelectionModel = table.getSelectionModel();
      tableSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
      table.getSelectionModel().addListSelectionListener(new AlbumTableSelectionListener());
View Full Code Here

   */
  public TableNodeView(HeaderInfo nodeInfo) {
    headerInfo = nodeInfo;
    headerInfo.addObserver(this);
    tableModel = new NodeTableModel();
    nodeTable = new JTable(tableModel);
    nodeTable.getSelectionModel().addListSelectionListener(this);
    nodeTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    setLayout(new BorderLayout());
    add(new JScrollPane(nodeTable), BorderLayout.CENTER);
  }
View Full Code Here

    // Check catalog furniture count equals home furniture count
    assertEquals("Different furniture count in list and home",
        homeFurniture.size(), home.getFurniture().size());

    // 3. Create a table that displays home furniture
    JTable table = new FurnitureTable(home, preferences);
    // Check home furniture count equals table row count
    assertEquals("Different furniture count in home and table",
        home.getFurniture().size(), table.getRowCount());
   
    // 4. Check the displayed depth in table are different in French and US version
    for (int row = 0, n = table.getRowCount(); row < n; row++) {
      preferences.setUnit(LengthUnit.INCH);
      String widthInInch = getRenderedDepth(table, row);
      preferences.setUnit(LengthUnit.CENTIMETER);
      String widthInMeter = getRenderedDepth(table, row);
      assertFalse("Same depth in different units",
View Full Code Here

    List<HomePieceOfFurniture> homeFurniture =
      createHomeFurnitureFromCatalog(preferences.getFurnitureCatalog());
    Home home = new Home(homeFurniture);
   
    // Create a furniture table
    JTable table = new FurnitureTable(home, preferences);
    JFrame frame = new JFrame("Furniture table Test");
    frame.add(new JScrollPane(table));
    frame.pack();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
View Full Code Here

        gResult = new GridSwing();

        TableSorter sorter = new TableSorter(gResult);

        tableModel   = sorter;
        gResultTable = new JTable(sorter);

        sorter.setTableHeader(gResultTable.getTableHeader());

        gScrollPane = new JScrollPane(gResultTable);
View Full Code Here

    // There is no-where else to put this.
    // Add a mouse listener to the Table to trigger a table sort
    // when a column heading is clicked in the JTable.
    public void addMouseListenerToHeaderInTable(JTable table) {
        final TableSorter sorter = this;
        final JTable tableView = table;
        tableView.setColumnSelectionAllowed(false);
        MouseAdapter listMouseListener = new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                TableColumnModel columnModel = tableView.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = tableView.convertColumnIndexToModel(viewColumn);
                if (e.getClickCount() == 1 && column != -1) {
                    //System.out.println("Sorting ...");
                    int shiftPressed = e.getModifiers()&InputEvent.SHIFT_MASK;
                    boolean ascending = (shiftPressed == 0);
                    sorter.sortByColumn(column, ascending);
                }
            }
        };
        JTableHeader th = tableView.getTableHeader();
        th.addMouseListener(listMouseListener);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JTable$DateTableCellRenderer

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.