Netbeans IDE 6.91 Horizontal Center Not Clickable

I am decent with Java programming, but very new to GUI development. I wanted to make a console game of blackjack, which I made several years ago, in one where people can play through the graphical interface that I create using netbeans. I think that without a GUI, most people will not be serious about the game when I add it to my work portfolio.

i created a JFRAME with a size equal to 1000X700 pixels, and on top of that was a JPanel with a dark green background to simulate a blackjack table.

on top of the dark green JPanel I have a small 60X93 JLabel with an icon installed on the back of the game card. this represents the dealer, and I wanted to center it horizontally and vertically on top of the JPanel on which it lies.

however, in the netbeans toolbar for a particular GUI, the center horizontal and vertical center parameters are grayed out and will not be available even if I select JLabel, which is the dealer. I even tried clicking shift to select the JLabel AND JPanel it is on, but still the options "center horizontally" and "center vertically" are grayed out.

Can someone please help me or suggest a guide please? thanks ... I spent 2 days searching on Google and I don’t understand how others are not facing this problem.

+3
source share
2 answers

Interest Ask. I have been working with NetBeans for many years, and frankly, I never noticed these icons until you just pointed them out. I can not get them to do anything.

, Java... GridBagLayout. GridBagLayout Swing. , , , .

: "" JPanel "Set Layout → Layage Layout Layout". , JPanel. "". , (, , ..). , , - "", , , - "". JLabel, , .

, - Java "Hello World"... GridBagLayout. !

+1

" " " "

, Matisse Designer, , . .

, JPanel JFrame, " ", () , . , , .

" " . , , , JFrame, . , .

JPanel JPanel, . , , , , .

JFrame, , , - , , , .

,

0

Source: https://habr.com/ru/post/1768559/


All Articles