i have several JPanels which each implement their logic, buttons and fields on their own. This panels are all added on a JFrame but sometimes on another Panel which is then added on the frame...
What i want to achive is that hte default button is the ok button for panel1 when any successor of it has the focus. And same for all the others...
How to do this? The panels itself dont have a JRootPane and I don't want to bother the Frame with the logic for that.
Every tip is welcome ;). Thanks in advance.
i have several JPanels which each implement their logic, buttons and fields on their own. This panels are all added on a JFrame but sometimes on another Panel which is then added on the frame...
What i want to achive is that hte default button is the ok button for panel1 when any successor of it has the focus. And same for all the others...
use CardLayout (Q&A on SO) and add separate Swing Action corresponding with each of card, use setEnabled(true/false) for Swing Action rather than add / remove Swing Action to JButton on then runtime
you can to use EventHandler, then there you can firing an action folded from String value (e.g. CardName + ButtonName + accesible context + UsersAccess + etc),
The panels itself dont have a JRootPane and I don't want to bother the Frame with the logic for that.
CardLayout