How can i return the number i have selected by clicking the numpad back to the parent panel? I need to use the method for the ease of accepting integers.
You could:
- Have a property in the parent class with the appropriate setter.
- When you call the child frame, pass an instance of the parent frame to the child frame.
- When you are done with your child frame, use the parent instance to change the property described in step 1 and call
dispose()
on the frame. This should allow your parent frame to have the value which was selected in the child frame.
How do i restrict the length of the JTextField? say i need to accept only two characters
You will need to create something like this since it seems that Java does not provide such functionality out of the box.
How do i transfer back the control from the child panel to the parent panel by clicking a button along with the data ofcourse?
There seems to be two options for this:
How can i design the child panel so that it does not show the header bar along with the close button
You will need to take a look at the setUndecorated(boolean bool)