• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

open new window

 
alona ariel
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to open a new window when we double click on a row in JTable ?

please somebody can give me the code
 
Swastik Dey
Rancher
Posts: 1602
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the event construct the object of the new window, and call setVisible(true) or show()
 
alona ariel
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a good way to add a mouse listener to a table
?
now how it can open a window?
 
alona ariel
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a good way do ad a mouse lisener to a table?

public static void main(String args[]) {

JFrame frame = new JFrame("smsll project");
TableModel model = new ColorTableModel();
JTable table = new JTable(model);

TableColumn column = table.getColumnModel().getColumn(3);

table.add(new mouse());




how open a new window with using the mouse
 
Swastik Dey
Rancher
Posts: 1602
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use MouseEvent.getClickCount() to identify double clicks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic