0

I have search on internet and found a lot of information about drawing in Java. But when I add new JFrame class in Netbeans then I cannot add a own JPane in the JFrame. Hopefully somebody can help me with this issue/question.

Drawing the JPane is possible when I make a new JFrame in a class, but I would like to use the design view in Netbeans. That is not possible when I make a new JFrame.

I look forward to receiving an answer.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Robert
  • 305
  • 1
  • 2
  • 14

2 Answers2

1

It looks like you made a JFrame instance yourself, and then tried to add a JPane(l) to it using NetBeans swing builder. This wont work. Try creating a new swing class using the swing builder and let netbeans make the Jframe. Also, make sure you set a correct layout for your JFrame.

Also, like BenCole said, I think you mean a JPanel, not a JPane.

Charnia
  • 605
  • 1
  • 5
  • 6
1

As an alternative, create your own top level container and add your designer panel to its content pane. Here's a simple example. In this way you can limit the use of the designer to a single panel, while you explore other layouts.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045