Reputation: 13509
I spent a long time creating a nice Dialog using Netbeans (Matisse), and now I realise that I want it as JPanel instead.
Is there any way of converting the Dialog to Panel in Netbeans. The blasted GUI editor does not allow me to modify any of the code.
Upvotes: 0
Views: 1108
Reputation: 857
You can play a trick on Netbeans to convert it, with all your code:
Assuming your dialog class is called MyDialog:
JDialog
by JPanel
in the class definition, and save as MyDialogPanel.java (overwriting the empty panel you have created).JDialogFormInfo
by JPanelFormInfo
, and save as
MyDialogPanel.form (overwriting the empty panel you have created).Upvotes: 1
Reputation: 14413
Just open navigator in design mode in jdialog, copy components and paste in jpanel view. Like in below image.
As always @MadProgrammer recommends, if you don't add directly to the jdialog and instead of a custom container (like a jpanel), then it's easy to put in another components :D
Upvotes: 1
Reputation: 13509
Ah. Figured it out. Just need to create a JPanel Netbeans class. Then I can just copy and paste the components across from the JDialog by going into the navigator view.
Upvotes: 0