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.
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.
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 ]
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.