javax.swing.JTable.setRowSelectionAllowed()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(215)

本文整理了Java中javax.swing.JTable.setRowSelectionAllowed()方法的一些代码示例,展示了JTable.setRowSelectionAllowed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTable.setRowSelectionAllowed()方法的具体详情如下:
包路径:javax.swing.JTable
类名称:JTable
方法名:setRowSelectionAllowed

JTable.setRowSelectionAllowed介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

logTable.setRowSelectionAllowed(true);
logTable.getSelectionModel().addListSelectionListener(
    new ListSelectionListener() {

代码示例来源:origin: stackoverflow.com

table.setRowSelectionAllowed(true);
table.setShowGrid(false);
table.setDefaultRenderer(String.class, new VisitorRenderer());

代码示例来源:origin: pentaho/mondrian

jTable1.setRowSelectionAllowed(false);
jScrollPane1.setViewportView(jTable1);

代码示例来源:origin: ron190/jsql-injection

this.tableValues.setColumnSelectionAllowed(true);
this.tableValues.setRowHeight(20);
this.tableValues.setRowSelectionAllowed(true);
this.tableValues.setCellSelectionEnabled(true);
this.tableValues.setGridColor(Color.LIGHT_GRAY);

代码示例来源:origin: net.sf.jt400/jt400

/**
Sets the indicator for whether the rows can be selected.

@param  selectable  The value indicating if the rows can be selected.
**/
  public void setRowSelectionAllowed (boolean selectable)   // @A2
  {
    table_.setRowSelectionAllowed(selectable);
      }

代码示例来源:origin: ron190/jsql-injection

this.networkTable.setRowSelectionAllowed(true);
this.networkTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
this.networkTable.setRowHeight(20);

代码示例来源:origin: stackoverflow.com

private void selectRows(JTable table, int start, int end) {
   // Use this mode to demonstrate the following examples
   table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
   // Needs to be set or rows cannot be selected
   table.setRowSelectionAllowed(true);
   // Select rows from start to end if start is 0 we change to 1 or leave it (used to preserve coloums headers)
   table.setRowSelectionInterval(start, end - 1);
 }

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

/**
 * Init XbayaEnhancedList
 */
private void init() {
  this.tableList = new Vector<T>();
  this.table = new JTable(new DefaultTableModel());
  this.table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  this.table.setRowSelectionAllowed(true);
  this.scrollPane = new JScrollPane(this.table);
  this.scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
}

代码示例来源:origin: cytoscape/application

/**
 * @return Returns the metadataTable.
 */
private JTable getMetadataTable() {
  if (metadataTable == null) {
    metaTM.addTableModelListener(new metadataTableListener());
    metadataTable = new JTable(metaTM);
    metadataTable.setRowSelectionAllowed(true);
  }
  return metadataTable;
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createTable_unversionned() {
  $objectMap.put("table_unversionned", table_unversionned = new JTable());
  
  table_unversionned.setName("table_unversionned");
  table_unversionned.setAutoResizeMode(3);
  table_unversionned.setRowSelectionAllowed(true);
  table_unversionned.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseClicked", this, "doMouseClicked__on__table_unversionned"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createTable_modified() {
  $objectMap.put("table_modified", table_modified = new JTable());
  
  table_modified.setName("table_modified");
  table_modified.setAutoResizeMode(3);
  table_modified.setRowSelectionAllowed(true);
  table_modified.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseClicked", this, "doMouseClicked__on__table_modified"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createTable_outofdate() {
  $objectMap.put("table_outofdate", table_outofdate = new JTable());
  
  table_outofdate.setName("table_outofdate");
  table_outofdate.setAutoResizeMode(3);
  table_outofdate.setRowSelectionAllowed(true);
  table_outofdate.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseClicked", this, "doMouseClicked__on__table_outofdate"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createTable_outofdateAndModified() {
  $objectMap.put("table_outofdateAndModified", table_outofdateAndModified = new JTable());
  
  table_outofdateAndModified.setName("table_outofdateAndModified");
  table_outofdateAndModified.setAutoResizeMode(3);
  table_outofdateAndModified.setRowSelectionAllowed(true);
  table_outofdateAndModified.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseClicked", this, "doMouseClicked__on__table_outofdateAndModified"));
}

代码示例来源:origin: ribomation/DroidAtScreen1

private JComponent createDevicesTable() {
  JTable tbl = new JTable(app.getDeviceTableModel());
  tbl.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
  tbl.setRowSelectionAllowed(true);
  tbl.setShowHorizontalLines(true);
  tbl.setFillsViewportHeight(true);
  tbl.setPreferredScrollableViewportSize(new Dimension(450, 150));
  JScrollPane pane = new JScrollPane(tbl);
  pane.setBorder(BorderFactory.createTitledBorder("Devices"));
  return pane;
}

代码示例来源:origin: nl.cloudfarming.client/planning-tactical

/** 
 * This method is called from within the constructor to
 * initialize the form.
 */
private void initComponents() {
  setLayout(new MigLayout("wrap 1"));
  cropProtectionTable.setRowSelectionAllowed(true);
  scrollPane.setViewportView(cropProtectionTable);
  this.add(scrollPane);
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createItems() {
  $objectMap.put("items", items = new JTable());
  
  items.setName("items");
  items.setAutoResizeMode(3);
  items.setRowSelectionAllowed(true);
  items.addComponentListener(JAXXUtil.getEventListener(ComponentListener.class, "componentResized", this, "doComponentResized__on__items"));
  items.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseClicked", this, "doMouseClicked__on__items"));
}

代码示例来源:origin: senbox-org/snap-desktop

public static Item<JTable> createTableItem(String name, int rows, int columns) {
  JTable table = new JTable(rows, columns);
  table.setCellSelectionEnabled(false);
  table.setColumnSelectionAllowed(false);
  table.setRowSelectionAllowed(false);
  table.setShowGrid(true);
  return new DefaultItem<>(name, table);
}

代码示例来源:origin: cmu-phil/tetrad

private void switchView(boolean a, boolean b) {
  impliedJTable().setModel(new ImpliedCovTable(wrapper, a, b));
  //     impliedJTable().getTableHeader().setReorderingAllowed(false);
  impliedJTable().setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  impliedJTable().setRowSelectionAllowed(false);
  impliedJTable().setCellSelectionEnabled(false);
  impliedJTable().doLayout();
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
protected void initComponents() {
  tableModel = new InformationTableModel();
  getTable().setModel(tableModel);
  getTable().setTableHeader(null);
  getTable().addMouseListener(new PopupHandler());
  getTable().setShowGrid(false);
  getTable().setRowSelectionAllowed(false);
  getTable().setColumnSelectionAllowed(false);
  getTable().setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  add(new JScrollPane(getTable()));
}

代码示例来源:origin: cmu-phil/tetrad

private void switchView(boolean a, boolean b) {
  try {
    impliedJTable().setModel(new StandardizedSemImImpliedCovTable(getSemIm(), a, b));
    //     impliedJTable().getTableHeader().setReorderingAllowed(false);
    impliedJTable().setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    impliedJTable().setRowSelectionAllowed(false);
    impliedJTable().setCellSelectionEnabled(false);
    impliedJTable().doLayout();
  } catch (IllegalArgumentException e) {
    return;
  }
}

相关文章

JTable类方法