• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Has FileDialog been deprecated?

 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. If somebody has a minute, I've been compiling a program and I keep getting a warning message that the program is using a deprecated api. I'm not sure what the source of this could be except for FileDialog.

Oh, on another note, I'm running the program but after the program runs, I no longer get focus the command prompt and have to shut and reopen the DOS window. Does using awt have something to do with this?

Thank you very much for reading my questions and for your time.
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FileDialog itself isn't deprecated. Do what the compiler says and use the "-deprecation" flag when you compile your code -- it will tell you exactly what's causing the error.

Is your focus problem just that the AWT program isn't exiting? To stop a GUI-based program, you have to explicitly call System.exit() (or use the built-in WINDOW_CLOSING event action that calls it.) Otherwise, even with the GUI gone, the command prompt is still tied up, as the JVM is still running.
 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for that. In my anxiety attack, I overlooked the compilation extension that could give me details. It says the show() method within FileDialog is the problem. I commented the method and the system ran a try-catch where it catches the loaded file being null, and with show() commented, it printed the catch statement and exited the program...giving me command line focus.

I'll keep messing around with it...I'll have to figure out how to display the dialog...and try to code a system exit in here...
[ August 19, 2005: Message edited by: Tom Griffith ]
 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
show() was deprecated as of 1.5...
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use setVisible(true) .
 
Tom Griffith
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah, I found setVisible(true) in the 1.5 documentation. Also, thank you very much for the System.exit() advice or whatever. I am going to incorporate a window closing event listener. Again, thank you...I haven't messed with awt in a long time.
 
reply
    Bookmark Topic Watch Topic
  • New Topic