#How does JOptionPane.showMessageDialog(...); work exactly?
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
When I have the following line :
the parentComponent is what exactly? An object which is your first screen in which the user interacts? The one from which the new screen popped out of for x reason?
parentComponent is just the component that the dialog should display above
If you had a window with a component on the left side & a component on the right side, and you specified the left component as the parent for the dialog, the dialog will appear above the left component
^ right. Usually you have it open from an action like a button press, which is on a panel on a frame. You don't have to define it (I believe null works) but alot of JOptionPane options are overloaded which if you want to customize the window more than default, you can. Bro Code on YouTube covers SWING on his channel and did a video on this.