Reputation: 1254
I have a JFrame with some components made in NetBeans gui designer. One of the components is a JPanel. How do i set that JPanel to another class that extends JPanel (and then draw to the panel from that class)?
Upvotes: 1
Views: 1174
Reputation: 264
Since your component is (also) a JPanel you can install it in NetBeans' components palette. This enables you to drag/drop it into the designer.
Programmatically (assuming you don't use NetBeans for building your GUI) the call you want to look for is something alike to:
frameInstance.setContentPane(yourJPanelDescendant);
Upvotes: 2