Java Swing Question and Answers
30. | What is the main difference between Dialog and Frame? |
---|---|
A FRAME can exists on its own , where as a DIALOG cannot exist on its own. In other words, FRAME is a primary window, where as the DIALOG box is secondary window. The dialog boxes are of two types:
public Dialog( Frame parent, String title, boolean modal) Here: |
|
31. | Explain Thread Rule in Swing? |
---|---|
Once a swing component has been realized, i.e. the component has been painted on screen or it is ready to painted, all the code that might affect or depend on the state of that component should be executed in the event dispatching thread. This is called thread rule in swing. | |