File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Select all table's fields --- CTRL C!!??

 
Franco Lucci
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jdbTable with a resultset displayed.
I'd like to select all fields (as CTRL C) and with CTRL V to past it in a excel sheet.
I tried with

public void jButton_actionPerformed(ActionEvent e) {

jdbTable2.selectAll();
e.setSource(jdbTable2); //table is a JTable
ActionListener copyAction2 = jdbTable2.getActionMap().get("copy");
copyAction2.actionPerformed(e);

}

but in this way I copy only one row ... but I want to select all the rows.
Is there any way to do it?

thanks.
 
Franco Lucci
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I resoled ... it's a problem of jbuilderX ....
in jbuilderx the multiple row selection is in this way:
jdbTable2.getSelectionModel().setSelectionMode (ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33688
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Franco,
Glad to hear you resolved the problem. I'm moving this to IDE's for future readers of this thread.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic