I used this for 3 radio buttons called Beginner, Intermediate, Expert. Used borderlayout.west and added all of them to a group box. My problem is that they're not all alligned even if x is 0 everytime(only changed y). Intermediate is a little to the left, probably because it's longer than the rest. Any fixes? Thanks!
X is left to right, Y is top to bottom, so like 10, 20 is ten units to the right, and 20 down, not trying to sound smart or anything but the illustration he made was backwards
When ever I make a program with a Gui and I add a JLabel or a JButton then it wont show up untill I re-size the window. Does anyone else have this problem?
question. when changing the gridx and gridy, they don't change, plus from experimenting a bit it seems that the coordinates are relative to the label themselves and not the page. Any help here on that would be great
Good tutorial, You mention that SWING is difficult without a visual editor, VE is available for eclipse, I think using VE is not very straight forward though, maybe worth a tutorial!! Cheers again mate!
Hii.... . .you done a great job but i want to adjust labels and button on LEFT most side Of frame using GribBagContainer i've many Objects but i can't.. . . plz help
Hi.. The video is gud and useful.. I just need a small clarification.. dont we have to set layout for a panel ? It seems that it picks up the layout when you send gridbaglayout object when u add the object.. I used to set the layout separately in my code.. can you jst clarify?
u would be doin all of us a favour if u could upload the videos on rapidshare or sumthin (not on ShareCash plz!) or create a torrent n post us a link.....this is cuz when i try to download ur vid, it says format not detected......
*thumbs up* well explained . this is awesome nd helpful for someone like me ! i have a question mr.javahelp . i would like to change the bg of my frame and the buttons also . is it possible ? if yes , how can i do that ? tnx for ur help and i'll be waiting for ur reply .. :))
hey java dude can u help me..??...how do u place a text field next 2 the JLabel... i am on a really hard assignment i need to have a text field to enter data...like in a form????...PLEASE HELP I AM ON A DEADLINE....that one thing that is missing from this vid....
Hi MrJavaHelp, I need help. Smiles. I am creating a GUI address book and I'm not sure how to ad the JTextFields. Could you explain? Also, I need to add two buttons, however when I do, I can't re-arrange them to move to the BOTTOM of my JFrame. Can you also explain that for me. I love your videos, PLEASE keep making them. Thanks.
This comment has received too many negative votesshow
Firstly, stop saying "Gooey", it isn't professioanl. It's pronounced as "G-U-I", the same way as if you would pronounce "I-S-O" or "S-M-D". Oh, and it does in fact make you sound like you do not know what your talking about.
@chamillion02 Isn't it ironic that you correct someones grammar with poorly constructed sentences? "It's pronounced as"; eliminate the word "as", it's redundant and unnecessary. When you use the term "in fact" it should be separated from the sentence with a semicolon and comma . eg. "Your grammar is; in fact, terrible". Finally, you ended your comment with a preposition which is; in fact, terrible grammar practice.
@chamillion02 So basically you are telling me that you pronounce DOS as D.O.S and LAN as L.A.N? GUI is in fact pronounced "Gooey". Oh, stop using "your" in place of "you're". I know this post is a year old but I.D.G.A.F!
Not knowing how to spell or use proper grammar is also not very PROFESSIONAL. If YOU'RE going to try to correct someone, at least make sure you know what you're talking about first, and how to convey it correctly.
I am in a computer science program currently learning how to build GUI's in Java, and all of my teachers and colleagues pronounce it as "gooey". It is widely used in the CS world and not incorrect at all.
@jdayguides Well guess what? You are a NERD for watching it fool! At least I have an excuse because I'm in college and you are probably just a troll. So shut the fuck up!
@chamillion02 You should also have you're in the last line because you meant to say "what you are talking about." Your is used with possession. So stop posting useless comments. We're all trying to learn something.
@chamillion02 You should also have you're in the last line because you meant to say "what you are talking about." Your is used with possession. So stop posting useless comments. We're all trying to learn something.
@chamillion02 You should also have you're in the last line because you meant to say "what you are talking about." Your is used with possession. So stop posting useless comments. We're all trying to learn something.
MrJavaHelp i have a question for u.. well i have a panel inside of a frame wich has a jButton , 2 jTextfield and a Jlabel, when i press the button i go to another panel wich contains more elements, the thing is i would like to have my first panel centered in the window.. im using a cardLayout for changing panels.. what do u suggest?.. thanks
Thanks, I've had a heck of a time finding good how-to's for GUI's using Eclipse without adding a plugin for visual editing, this was really helpful to me.
nice nice nice :))) fanks brother
surajgenius 1 week ago
omg....that's what i need for my application...you help me alot.
thank you....
thank a millions!!!
yiongjian 3 weeks ago
Oracle should put that tutorial on their website.
arturzxc 1 month ago 2
Comment removed
xXCrypticalCodexX 1 month ago
im using Jgrasp. Copied you coding exactly and still didn't work... any advice?(copied it EXACTLY)
MudddaFuddda 1 month ago in playlist More videos from MrJavaHelp
nice. but your microphone is really annoying..
Asoriaz 2 months ago
I used this for 3 radio buttons called Beginner, Intermediate, Expert. Used borderlayout.west and added all of them to a group box. My problem is that they're not all alligned even if x is 0 everytime(only changed y). Intermediate is a little to the left, probably because it's longer than the rest. Any fixes? Thanks!
SlackerusSupremus 3 months ago
X is left to right, Y is top to bottom, so like 10, 20 is ten units to the right, and 20 down, not trying to sound smart or anything but the illustration he made was backwards
gr1mtoy6100 3 months ago
@gr1mtoy6100 exactly what i thought when i saw it lol btw i'm on 1st semester of CS and i'm awesome
just kidding
Nikixos 3 months ago
@Nikixos C sharp or computer science?
gr1mtoy6100 3 months ago
AWESOME ! JUST AWESOME!!!!!
Thank you so much sir!
zhu711 3 months ago
Good Stuff. Nice and slow and not super complicated with good explainations. Thanks man.
buildakicker 3 months ago
well done mr.java help
thanks alot for your videos
sam62612 4 months ago
When ever I make a program with a Gui and I add a JLabel or a JButton then it wont show up untill I re-size the window. Does anyone else have this problem?
MrPitbull917 4 months ago
@MrPitbull917 yes, wtf!?
torococostudio 4 months ago
GOOD EXPLAINATION
panpan2733 5 months ago
Better than my ex prof :D
Nice job
Bigville 6 months ago
Bro, if you are not a teacher you should be, you explain things well. Keep up the good work. A+
madcitizen1 6 months ago
hey man for some reason i cant position the buttons any help?
TheCorruption97 7 months ago
thanks you are life saver :)
FallenHunter1 7 months ago
good one.. thanks.
yusufjiruwala 7 months ago
question. when changing the gridx and gridy, they don't change, plus from experimenting a bit it seems that the coordinates are relative to the label themselves and not the page. Any help here on that would be great
grulloc 8 months ago
@grulloc i just had the same problem. i solved it by adding height and width 2 component :)
whizZen 8 months ago
@whizZen how?
TheCorruption97 7 months ago
Insets(int top, int left, int bottom, int right)
jurosh1 8 months ago
well done. I just would like to say one thing... when using coordinates its(X,Y) not (Y,X). just throwing that out there.
panthergoalie 9 months ago
Im trying to add a JList to my JFrame using this layout but it always stays centered what should I do?
toxton1 9 months ago in playlist JAVA
Good tutorial, You mention that SWING is difficult without a visual editor, VE is available for eclipse, I think using VE is not very straight forward though, maybe worth a tutorial!! Cheers again mate!
irishdude79 9 months ago
This has been flagged as spam show
You sir are a God at explaining compared to my Object Oriented Java CSIS380 teacher.
rayn1988 10 months ago
Comment removed
rayn1988 10 months ago
Thank you very much. Your videos are helping me a lot in my high school Java class.
UberGodify 11 months ago
I say "gooey" as well like everybody else LOL
Well explained - Thank you
markus573 11 months ago
<3
nahsoramor 1 year ago
when I use gridheight or gridwidth the program doesn't place the buttons in the right order :l
youboob6022 1 year ago
How do you put them at TOP LEFT corner?
TRana9 1 year ago 14
@TRana9 North east
toy741life 3 months ago
Comment removed
Th3Oth3r95 2 months ago
@TRana9 gridx = 0 gridy = 0
BenGeocth 2 weeks ago
Comment removed
r4jk3 2 weeks ago
@BenGeocth thats not correct.
r4jk3 2 weeks ago
Thank you very much <3
TRana9 1 year ago
Very useful tutorial, helped my learn a better alternative to GridLayout which is very limited.
aqib14 1 year ago
Mann, you´re great !!! Thanks !!!
LittleBoyNumber1 1 year ago
i dont know wy but my 0;0 coordinates is in the middle of the screen :/
Ernestas23 1 year ago
This has been flagged as spam show
Breaking your habit naughty women benaughtyman.info
AbaagailKaci 1 year ago
Hii.... . .you done a great job but i want to adjust labels and button on LEFT most side Of frame using GribBagContainer i've many Objects but i can't.. . . plz help
2626adnan 1 year ago
Hi.. The video is gud and useful.. I just need a small clarification.. dont we have to set layout for a panel ? It seems that it picks up the layout when you send gridbaglayout object when u add the object.. I used to set the layout separately in my code.. can you jst clarify?
braveanand 1 year ago
clear, succinct and free of jargon. This is how a tutorial should be, well done :)
malicant123 1 year ago
cool i'll watch the rest of vids..
yemenhar 1 year ago
thanks so match
khaledMohammedRagheb 1 year ago
what does GetContentPane() do?
tarunpai 1 year ago
Hey man.....i REALLY like ur vids.....
u would be doin all of us a favour if u could upload the videos on rapidshare or sumthin (not on ShareCash plz!) or create a torrent n post us a link.....this is cuz when i try to download ur vid, it says format not detected......
Thanks,
Abhiram.
AbhiramH 1 year ago
thanks for the video man . It really helped me out
n7router 1 year ago
TNX MAN! your vid helps me a lot :D
ionik3 1 year ago
I found out you need to specify the gridWidth, gridHeight also with the gridX and gridY coordinates in order to get the correct results.
Also, it does work with the content pane and components don't need to be added to a JPanel as in the video.
gamedevMike 1 year ago
Comment removed
gamedevMike 1 year ago
@8:13 insets arguments are top, left, bottom, right according to Eclipse.
DumbestCrayon 1 year ago
Thank you =D
MrBagamen 1 year ago
thnx! HELPS ME ALOT!!!!!!!! :D
florachu2121 1 year ago
Very nice but the audio is not so good
LauwereysM 1 year ago
That was the best damned video I have ever seen thank you for posting it helped a lot!
JittersInternational 1 year ago
tnx mr.javahelp...more power..
weeeee03 1 year ago
How do i make the:
frame.getContentPane().add(panel, BorderLayout.NORTH);
also position the panel to the west? I want it to be both NORTH and west:D
prantare 1 year ago
Awesome tutorials man! Thank you very much. :-D
prantare 1 year ago
Agreed, this has been the most HelpfulTutorial in regards to layouts using a grid. Thanks!!!
micajah2001 1 year ago
This has been flagged as spam show
nice video man... well explained... you got me out of a lot of trouble. haha (Y)
awesumkid99 1 year ago
This has been flagged as spam show
nice video man... well explained... you got me out of a lot of trouble. haha (Y)
awesumkid99 1 year ago
nice video man... well explained... you got me out of a lot of trouble. haha (Y)
awesumkid99 1 year ago
He actually got the axis wrong. X is the first parameter and goes from left to right. Y is the second parameter and goes from top to bottom.
GamingJediPwns 1 year ago
Man that due was so fast at typing out 5 JLabels lol
GamingJediPwns 1 year ago
*thumbs up* well explained . this is awesome nd helpful for someone like me ! i have a question mr.javahelp . i would like to change the bg of my frame and the buttons also . is it possible ? if yes , how can i do that ? tnx for ur help and i'll be waiting for ur reply .. :))
lezahann 1 year ago
@lezahann you mean the background color?
you can try using
yourFrame.setBackground(Color.anycolor); for example
Frame1.setBackground(Color.CYAN);
and it is the same for the buttons. hope this is the answer ur looking 4
awesumkid99 1 year ago
even if i set south, it still appears in the nroth? can anyone help me?
hermanjr 2 years ago
@hermanjr I tested the code worked fine for me, maybe a typo?
public static void main(String[] args) {
JFrame frame = new JFrame("Test");
frame.setSize(500,500);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new GridBagLayout());
frame.getContentPane().add(panel, BorderLayout.WEST); // key is the North, South, East, West
GridBagConstraints c = new GridBagConstraints();
dashbyictfd 1 year ago
I've discovered that if you want to use the anchor field, you need to set weightx or weighty to non-zero.
gamedevMike 2 years ago
Well explained. Good job.
ruskido 2 years ago 20
thanks ...but could you tell me how to set button's size,if I want to create a small one what i have to do
saddamdon 2 years ago
hey java dude can u help me..??...how do u place a text field next 2 the JLabel... i am on a really hard assignment i need to have a text field to enter data...like in a form????...PLEASE HELP I AM ON A DEADLINE....that one thing that is missing from this vid....
ixy1987 2 years ago
That was awsome and very helpfull go on man you are great
adham323 2 years ago 2
Hi MrJavaHelp, I need help. Smiles. I am creating a GUI address book and I'm not sure how to ad the JTextFields. Could you explain? Also, I need to add two buttons, however when I do, I can't re-arrange them to move to the BOTTOM of my JFrame. Can you also explain that for me. I love your videos, PLEASE keep making them. Thanks.
RoyceWarren 2 years ago
Hi MrJavaHelp
Thanks a ton man..
ur Swing tutorials were really helpful...
9820532040 2 years ago
This comment has received too many negative votes show
Firstly, stop saying "Gooey", it isn't professioanl. It's pronounced as "G-U-I", the same way as if you would pronounce "I-S-O" or "S-M-D". Oh, and it does in fact make you sound like you do not know what your talking about.
chamillion02 2 years ago
I realized how its pronounced ... I say "gooey" because its faster to say rather than spelling it out each time.
Similarly, people prefer to say "cuz" rather than "because" due to the fact that its shorter.
thanks for your comment
MrJavaHelp 2 years ago 56
@MrJavaHelp Very true. GUI is 3 syllables, where as "gooey" is only 2 :)
314rce 11 months ago
@MrJavaHelp As a matter of a fact, GUI can correctly be pronounced as "gooey". chamillion02 failed,
you win.
scarfulify 4 months ago
@chamillion02 Yeah! [/sarcasm] You can't spell, very professional on your part.
letsprogram 1 year ago
Comment removed
DumbestCrayon 1 year ago
@chamillion02 Isn't it ironic that you correct someones grammar with poorly constructed sentences? "It's pronounced as"; eliminate the word "as", it's redundant and unnecessary. When you use the term "in fact" it should be separated from the sentence with a semicolon and comma . eg. "Your grammar is; in fact, terrible". Finally, you ended your comment with a preposition which is; in fact, terrible grammar practice.
DumbestCrayon 1 year ago 2
@chamillion02 So basically you are telling me that you pronounce DOS as D.O.S and LAN as L.A.N? GUI is in fact pronounced "Gooey". Oh, stop using "your" in place of "you're". I know this post is a year old but I.D.G.A.F!
n3wbizzle666 1 year ago
@n3wbizzle666 you're and your. aren't they pronounced the same?
lhyx1990 1 year ago
@lhyx1990 They're pronounced the same but they do have different meanings. It confuses people that actually use them properly.
n3wbizzle666 1 year ago
@chamillion02 All profession programmers say 'gooey'. Stop talking like you actually know what you are saying. Imbecile.
floopsie666 1 year ago
@chamillion02
Not knowing how to spell or use proper grammar is also not very PROFESSIONAL. If YOU'RE going to try to correct someone, at least make sure you know what you're talking about first, and how to convey it correctly.
I am in a computer science program currently learning how to build GUI's in Java, and all of my teachers and colleagues pronounce it as "gooey". It is widely used in the CS world and not incorrect at all.
Better luck next time.
VeggiePirateLorryn 1 year ago
@chamillion02 "it isn't professioanl"
This guy sounds like such a nerd. L-O-L
jdayguides 1 year ago 2
@jdayguides Well guess what? You are a NERD for watching it fool! At least I have an excuse because I'm in college and you are probably just a troll. So shut the fuck up!
womo1975 3 months ago
@chamillion02
I know many professionals who use the term GOOEY. Shut up.
FISHGOMOO4321 11 months ago
@chamillion02 I don't I know anyone who says "I-S-O" or "G-U-I".
Cizzocakes 10 months ago
@chamillion02 Fuck you whoever you are! idiot!
bluestone01071 9 months ago
@chamillion02 You should also have you're in the last line because you meant to say "what you are talking about." Your is used with possession. So stop posting useless comments. We're all trying to learn something.
zackrichards1994 5 months ago
This has been flagged as spam show
@chamillion02 You should also have you're in the last line because you meant to say "what you are talking about." Your is used with possession. So stop posting useless comments. We're all trying to learn something.
zackrichards1994 5 months ago
This has been flagged as spam show
@chamillion02 You should also have you're in the last line because you meant to say "what you are talking about." Your is used with possession. So stop posting useless comments. We're all trying to learn something.
zackrichards1994 5 months ago
MrJavaHelp i have a question for u.. well i have a panel inside of a frame wich has a jButton , 2 jTextfield and a Jlabel, when i press the button i go to another panel wich contains more elements, the thing is i would like to have my first panel centered in the window.. im using a cardLayout for changing panels.. what do u suggest?.. thanks
vince015 2 years ago
nice tutorial man.. helped me a lot
vince015 2 years ago 2
Nice explanation, thanks.
Shlavlak 2 years ago
Thanks, I've had a heck of a time finding good how-to's for GUI's using Eclipse without adding a plugin for visual editing, this was really helpful to me.
obannonsleap 2 years ago
This is like the only tutorial on positioning objects in a frame on the whole internet, really good job man!
MrKiller00224 2 years ago 2