This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Custome generated alert message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Custome generated alert message" Watch "Custome generated alert message" New topic
Author

Custome generated alert message

Arun Chidam
Ranch Hand

Joined: May 08, 2006
Posts: 79
Hi All,

Is there a way to display a time based(say for 3secs) custom generated information message on top of JTable whenever data is updated in the table.

Thanks,
Arun


SCJP 1.4, SCWCD 1.4
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3983
    
  18

You could create a JDialog (possibly through the JOptionPane class) for your message. Set a javax.swing.Timer to 3 seconds. When it fires, hide the dialog.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Arun Chidam
Ranch Hand

Joined: May 08, 2006
Posts: 79
Thanks Stephan
Arun Chidam
Ranch Hand

Joined: May 08, 2006
Posts: 79
Hi Stephan,

can we use InternalFrame here rather than JOptionPane?....i want to display the popup message more as a customized message rather than standard defined dialogs from JOptionpane?

Thanks,
Arun
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3983
    
  18

You can use JOptionPane for this as well. Just create a new JOptionPane and then treat it like you would treat the content pane of your custom window. When you're done, you can call createDialog() and it will create a JDialog out of your custom panel.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3983
    
  18

If you need more customization, you can also create a JDialog instance yourself directly. I would advise against the use of JInternalFrame, because it requires a JDesktopFrame to be displayed in.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4986
    
    8

Just pass a JPanel as the message parameter of JOptionPane's show... method.


luck, db
There are no new questions, but there may be new answers.
Arun Chidam
Ranch Hand

Joined: May 08, 2006
Posts: 79
Thanks Stephan,Darryl

Yes it worked as required

Thanks,
Arun
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custome generated alert message
 
It's not a secret anymore!