Squeazer
Squeazer

Reputation: 1254

Add a JPanel to a JFrame in NetBeans designer

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

Answers (1)

S3lvatico
S3lvatico

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

Related Questions