This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes open new window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "open new window" Watch "open new window" New topic
Author

open new window

alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
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

Joined: Jan 08, 2009
Posts: 1449
    
    6

On the event construct the object of the new window, and call setVisible(true) or show()


Swastik
alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
This is a good way to add a mouse listener to a table
?
now how it can open a window?
alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
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

Joined: Jan 08, 2009
Posts: 1449
    
    6

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

You can use MouseEvent.getClickCount() to identify double clicks


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: open new window
 
Similar Threads
java script for open jsp file
open new browser window on click of button.
Open pdf file
Expiring a pdf document in the browser
eclipse 2.0