sisko
sisko

Reputation: 9900

Netbeans Java Swing Components undragable

I am trying to learn Java Swing with the aid of the Netbeans IDE. Following this tutorial, I find myself stuck when I try adding a Panel to a JFrame. The Panel, or any other component from the Swing Container, does not add to my design view.

I have tried dragging and right-clicking the component without success.

When I right-click the Panel component, I get various menu options including "paste item" but it is greyed out and inactive.

Upvotes: 0

Views: 856

Answers (1)

Costis Aivalis
Costis Aivalis

Reputation: 13728

Just click on the palette "Swing Containers" Panel button. In 7.2 and 7.2.1 it is a toggle switch. Then go to your JPanel and you will see your new JPanel moving along with your cursor. Move it to the location you want to have it and click again. Then you can resize it to the dimensions you like...

Netbeans IDE is an excellent production tool. If you are in the learning phase however, it is always better to avoid using powerful GUI-editors, in order to gain a better understanding of the concepts. You can do that using simple text editors.

You will find these links helpful: The Swing Tutorial, Java2s tutorial and Java Beginner Tutorial. And certainly you can ask Stackoverflow if you get stuck at some point, or want an opinion ...

Upvotes: 5

Related Questions