Examples of JXTable


Examples of org.jdesktop.swingx.JXTable

  }

  protected JPanel buildReplacementTable( MaliciousAttachmentTableModel tableModel )
  {
    final JPanel panel = new JPanel( new BorderLayout() );
    final JXTable table = new JXTable( tableModel );
    setupTable( table );
    JScrollPane tableScrollPane = new JScrollPane( table );
    tableScrollPane.setBorder( BorderFactory.createEmptyBorder() );

    JXToolBar toolbar = UISupport.createToolbar();

    addReplacementButton = UISupport.createToolbarButton( new AddFileAction() );
    toolbar.add( addReplacementButton );

    removeReplacementButton = UISupport.createToolbarButton( new RemoveReplacementFileAction( tableModel, table ) );
    toolbar.add( removeReplacementButton );
    removeReplacementButton.setEnabled( false );

    toolbar.add( UISupport.createToolbarButton( new HelpAction( HelpUrls.SECURITY_MALICIOUS_ATTACHMENT_HELP ) ) );

    panel.add( toolbar, BorderLayout.PAGE_START );
    panel.add( tableScrollPane, BorderLayout.CENTER );

    table.getSelectionModel().addListSelectionListener( new ListSelectionListener()
    {
      @Override
      public void valueChanged( ListSelectionEvent e )
      {
        if( removeReplacementButton != null )
        {
          removeReplacementButton.setEnabled( table.getSelectedRowCount() > 0 );
        }
      }
    } );

    panel.setBorder( BorderFactory.createLineBorder( new Color( 0 ), 1 ) );
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.