• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FileDialog problem

 
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys
I�m having a problem with open up a filedialog.
I have a rendered jlist and the are some items inside. The user, can right click any item and choose from a list some commands (print, save, update etc)

Everything works fine but when he clicks the SAVE option (again, right click and choose save)

FileDialog fd = new FileDialog(new JFrame(),"Save PAX list",FileDialog.SAVE);

I cannot use new JFrame() (as I did above) because it might block the application.

For this I�m trying to get the root by:

Component c = SwingUtilities.getRoot((Component)e.getSource());
JFrame myFrame = (JFrame)c;

And than:


FileDialog fd = new FileDialog myFrame,"Save PAX list",FileDialog.SAVE);

This get me a null frame :- (

Anyone?
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok I got it, i used Component invoker = popupMenu.getInvoker();
thank me
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> thank me

perhaps Dror Guzman might deserve a bit of credit?

http://forum.java.sun.com/thread.jspa?threadID=676077&tstart=0
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic