I am learning java and starting with the concepts of JPanels. currently the program i am testing with consists of two windows. the first window contains one button. on clicking the button the second window containing a numpad opens up. now the question i have is 1. 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. 2. how do i restrict the length of the JTextField? say i need to accept only two characters... 3. how do i transfer back the control from the child panel to the parent panel by clicking a button along with the data ofcourse? 4. how can i design the child panel so that it does not show the header bar along with the close button?
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:
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)