Terrance Samson wrote:I'm setting the exact width and height to the pixel
Terrance Samson wrote:Anyway, I tried it a few ways, but for some reason, if I successfully hid the window it closed the program. So to get around it, instead of hiding it I just set the coordinates to negative numbers, so that it wouldn't display on the screen no matter what resolution it's using.
Terrance Samson wrote:Yes, but when I did setVisible(false) it caused the program to exit! Even when I was debugging the debugger stopped.
Yes, but when I did setVisible(false) it caused the program to exit!
Yes, but when I did setVisible(false) it caused the program to exit! Even when I was debugging the debugger stopped.
Terrance Samson wrote:Paul Clapham, thanks for the code, but it's hiding the form before it starts the timer, so by then the program would already close. Though if I remember correctly, when you start the timer it will just freeze for that amount of time before it gets a chance to hide the form. So either way that wouldn't work, unless I'm overlooking something.
Terrance Samson wrote:Well actually I don't intend to show the window again because it shows at the beginning, hides and is replaced by a main window.
That would be even lousier a solution. Yes, if you have got incorrectly designed Swing code, not using layouts, any correction will take a very long time and be demanding to write.
Terrance Samson wrote:. . . two versions of the program . . .
Agree; use dialogue windows rather than messing about with multiple frames. As I said somewhere else a few minutes ago, one application, one JFrame.
Paul Clapham wrote:. . . have the main window start up and show a modal dialog instead.
Terrance Samson wrote:Well actually I don't intend to show the window again because it shows at the beginning, hides and is replaced by a main window. I realize it can be easier to make a small project to test a few things independently, but I didn't think it was necessary because I had gotten everything to work - or so it seemed, until I tried to run it in Linux.
Terrance Samson wrote:Well I don't know about a dialog window, because it must appear before the main window, and then the main window must only appear after this smaller window is closed.
You can of course use a JDialog as the introductory window. You can add buttons and panels to a dialogue window.
Paul Clapham wrote:. . .
1. Display the introductory window.
2. . . . dispose the introductory window . . .
Terrance Samson wrote:Paul Clapham, yes that's exactly correct, except that when I dispose of the first window it causes the program to close.
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
SKIP - a book about connecting industrious people with elderly land ownershttps://coderanch.com/t/skip-book