Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Custome generated alert message

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 12269
259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Arun Chidam
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stephan
 
Arun Chidam
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 12269
259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 12269
259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just pass a JPanel as the message parameter of JOptionPane's show... method.
 
Arun Chidam
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stephan,Darryl

Yes it worked as required

Thanks,
Arun
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic