Package javax.swing

Examples of javax.swing.JTable


    jb_save=new JButton("Save log on file");
    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();
View Full Code Here


  private BundleContext m_context = null;
  private ServiceRegistration sreg = null;

  public OsgiProbesTabUI(){
    this.innerTable=new JTable();
    this.innerTable.setPreferredScrollableViewportSize(new java.awt.Dimension(500,150));
    JScrollPane table = new JScrollPane(this.innerTable);
    this.add(table);
  }
View Full Code Here

  }

  public static void loadSearchResults(final String searchResults) {
    try {

      final JTable table = SearchWidget.getSearchTable();
      DefaultTableModel tableModel = SearchWidget.getTableModel();
      final String datafile = searchResults;
      final FileReader fin = new FileReader(datafile);

      tableModel = CSVTableModel.createTableModel(fin, null);
      if (tableModel == null) {
        JOptionPane.showMessageDialog(null,
            "Error Loading Search Results.", "Error",
            JOptionPane.ERROR_MESSAGE);

        ModelUtils.loadSearchResults(Constants.DATA_PATH
            + "search/search.blank");
        return;
      } else {

      }
      table.setModel(tableModel);
      final TableColumn hiddenLink = table.getColumnModel().getColumn(3);
      hiddenLink.setMinWidth(0);
      hiddenLink.setPreferredWidth(0);
      hiddenLink.setMaxWidth(0);
      hiddenLink.setCellRenderer(new InteractiveRenderer(3));
      final TableColumn hiddenIDS = table.getColumnModel().getColumn(4);
      hiddenIDS.setMinWidth(0);
      hiddenIDS.setPreferredWidth(0);
      hiddenIDS.setMaxWidth(0);
      hiddenIDS.setCellRenderer(new InteractiveRenderer(4));
View Full Code Here

   *
   *         Handles when a stream ends
   */
  public static void handleEndOfStream() {

    final JTable table = TabelPanel.table;
    if (table.getRowCount() == 0) {
      return;
    }
    if ((PlayerFunctions.repeat == false)
        && (PlayerFunctions.shuffle == false)) {

      PlayerFunctions.seekNext();
    } else if (PlayerFunctions.repeat == true) {

      PlayerFunctions.repeat();
    } else if (PlayerFunctions.shuffle == true) {

      PlayerFunctions.shuffle();

    }

    if (isOutOfFocus && Settings.isDisplayAlert()) {
      // ImageIcon albumArt = null;
      final int row = table.getSelectedRow();
      final String title = (String) table.getValueAt(row, 0);
      final String artist = (String) table.getValueAt(row, 1);
      final Font font = new Font("Dialog", Font.PLAIN, 13);
      final String information = String
          .format("<html>Now Playing:<br><strong>%s</strong><br><em>%s</em></br></html>",
              title, artist);
      /*
 
View Full Code Here

  };
 
  private static JComponent createTableComponent(String[] columnNames,
      Object[][] perMaterialData, Comparator<?>[] comparators) {
   
    JTable table = new JTable(perMaterialData, columnNames);
    table.setFillsViewportHeight(true);
   
    TableRowSorter<TableModel> sorter =
        new TableRowSorter<TableModel>(table.getModel());
   
    for (int col = 0; col < columnNames.length; ++col) {
      sorter.setComparator(col, comparators[col]);
    }
   
    table.setRowSorter(sorter);

    return new JScrollPane(table);
   
  }
View Full Code Here

    m_refreshButton.setMnemonic('I');
    return panel;
  }

  private JScrollPane createTable() {
    JScrollPane scroll = new JScrollPane(m_bundleTable = new JTable());
    scroll.setPreferredSize(new Dimension(100, 100));
    m_bundleTable.setMinimumSize(new Dimension(0, 0));
    m_bundleTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    m_bundleTable.setModel(new SimpleTableModel());
    m_bundleTable.getColumnModel().getColumn(0).setPreferredWidth(75);
View Full Code Here

    installPanel.add(installButton, BorderLayout.EAST);
    return installPanel;
  }

  private JScrollPane createTablePanel() {
    table = new JTable(panelModel);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.getTableHeader().setReorderingAllowed(false);
    initColumnSizes(table);
    JScrollPane tablePanel = new JScrollPane(table);
    tablePanel.setBorder(BorderFactory.createEtchedBorder());
View Full Code Here

   *
   * @return javax.swing.JTable
   */
  JTable getScriptTable() {
    if (scriptTable == null) {
      scriptTable = new JTable();
      scriptTable.setShowGrid(true);
      scriptTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    }
    return scriptTable;
  }
View Full Code Here

    for (final String option : options) {
      comboBox.addItem(option);
    }
    searchWidget.getContentPane().add(comboBox);

    searchTable = new JTable();
    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();
        e.getSource();
        if (c == KeyEvent.VK_DELETE) {

        } else if (c == KeyEvent.VK_ADD) {

        } else if (c == KeyEvent.VK_LEFT) {

        } else if (c == KeyEvent.VK_RIGHT) {

        } else if (c == KeyEvent.VK_ENTER) {

        }
      }
    });
    searchTable.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(final MouseEvent e) {
        if (e.getClickCount() == 2) {
          final JTable target = (JTable) e.getSource();

          target.getSelectedRow();
          MediaUtils.switchMedia(target);
        }

      }

      @Override
      public void mouseReleased(final MouseEvent e) {
        if (e.isPopupTrigger()) {
          final JTable source = (JTable) e.getSource();
          final int row = source.rowAtPoint(e.getPoint());
          final int column = source.columnAtPoint(e.getPoint());

          if (!source.isRowSelected(row)) {
            source.changeSelection(row, column, false, false);
          }

          popup.show(e.getComponent(), e.getX(), e.getY());
        }
      }
View Full Code Here

    }

  }

  public static void repeat() {
    final JTable table = TabelPanel.table;
    if (table != null) {

      final int index = table.getSelectedRow();
      table.setRowSelectionInterval(0, index);
      MediaUtils.switchMedia(table);

    } else {

    }
View Full Code Here

TOP

Related Classes of javax.swing.JTable

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.