java - Netbeans IDE 6.91 "center horizontally" not clickable -


i decent java programming, new gui development. wanted make console blackjack game made years ago 1 people can play via gui build using netbeans. think without gui, people won't take game when add working portfolio

i created jframe size set 1000x700 pixels , on top of jpanel background of dark green simulate blackjack table.

on top of the dark green jpanel have small 60x93 jlabel icon set of playing card. represents dealer , wanted center horizontally , vertically on top of jpanel on rests.

however, in netbeans tool bar particular gui "center horizontally" , "center vertically" options greyed out , not clickable when select jlabel dealer. tried shift clicking select both jlabel , jpanel on rests still "center horizontally" , "center vertically" options greyed out.

can please me or offer guidance please? thank you... have spent 2 days googling , don't understand how others have not run same problem.

interesting question. i've been working netbeans years, , honest i've never noticed icons before until pointed them out. i'm unable make them either.

however, if you're new gui development in java... should read layout managers, , spend time the gridbaglayout tutorial. gridbaglayout far popular layout manager in swing development. using exclusively if wanted, there handful of real-word situations in makes more sense use layout manager.

for immediate purposes: in inspector view, right-click on jpanel , select "set layout -> grid bag layout". you'll see layout manager in inspector tree view right below jpanel. right-click on , select "customize". window pop-up, , there can click on component you're interested in , adjust kinds of settings (e.g. margins, padding, etc). setting in interested "anchor", , value want "center". jlabel selected, can adjust setting either pull-down menu @ top-left... or graphically @ top-bottom.

one way or other, if you're going kind of java gui development beyond trivial of "hello world" examples... you're going using gridbaglayout soon. might dive in!


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -