Hey MrJavaHelp(er). Currently I'm a college student studying IT. Most of my courses have to do with programming. Among the languages is Java obviously. Can't thank you enough for these tutorials, they are very helpful!
Thank you for this tutorial. I created one just like it, however, after I tested it the first time, it would not show the menuBar the next time. What do I need to add so that it shows the menuBar each time I run it?
public class apples { public static void main(String[] args){ tuna object = new tuna(); object.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); object.setSize(1000, 700); object.setVisible(true); JMenuBar bar = new JMenuBar(); frame.setJMenuBar(bar); JMenu file = new JMenu("File"); }
I'm not completely sure because I can't see your tuna class, but it looks like you used TheNewBoston's tutorial, and if this is the case then you need to put everything that comes after object.setVisible(true) in the constructor of the Tuna class.
I've noticed in the past few videos your keyboard uses the same key for 1 and semicolon. just out of curiosity, what type of keyboard layout are you using?
Thanks, but how do you make it so when you click about, it does something else? I dont really get how clicking exit was related to where the exit coded was
This is what I was serching the web for 2 hrs back ;-) ... thanks for d tutorials.
RidgeEvan 23 hours ago
Hey MrJavaHelp(er). Currently I'm a college student studying IT. Most of my courses have to do with programming. Among the languages is Java obviously. Can't thank you enough for these tutorials, they are very helpful!
Two thumbs up.
Rick
hleinaas 1 month ago
Good Teacher
plutoamun 1 month ago
@plutoamun he is lol i'm 13 and I'm doing this, and i understand it
BenGeocth 3 weeks ago
my not work the exit and the class class exitaction implements ActionListener{ public void actionPerfomed (ActionEvent e) { System.exit(0);
the word exitaction has a erron on eclipse Description Resource Path Location Type
The type exitaction must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent)
they show that error.. }
gustavoindustry 3 months ago
I didn't need the bottom code; class exitaction implements ActionListener{ public void actionPerformed (ActionEvent e) { System.exit(0);
It worked fine without. Unless there is something else?
Can you make a tutorial on how to add writing when clicking the 'About' tab please?
TheSapsed 3 months ago
EXCELLENT!!!!
toy741life 3 months ago
awesome thanks a lot.. I wanted to know about this actionListener thingy..really helpful :)
KennethDcouto 5 months ago
Cheers for this!
neotees 6 months ago
Thanks buddy you helped me a lot
tuhinbhatt1 6 months ago
THANKS MAN!!! AWESOME
darkleo0608 6 months ago
thanks a lot maaaan!!! helped me with my assignment!!!!
do u have a tutorial that opens an image file and displays it on the JFrame??
triXter0612 7 months ago
@triXter0612 i can help you with that
razorbunny555 7 months ago
@razorbunny555 really? ok uhm,, I can send you my code to have a look at if you want. but where do I send it?
triXter0612 7 months ago
@triXter0612 did you recieve my message?
razorbunny555 7 months ago
Thanks a lot, this was helpful and well explained...
I don't know if it's true, but I read something about that it's not legit to mix swing and awt code... but nevermind, this works ;)
TheRealTobias 9 months ago
thank u ....................................
p1p37z 1 year ago
Thank you for this tutorial. I created one just like it, however, after I tested it the first time, it would not show the menuBar the next time. What do I need to add so that it shows the menuBar each time I run it?
eyveneen 1 year ago
Also, work on your conventions!
Canownueasy 1 year ago
I see you're trying, but enclosing everything in the main method is unreasonable.
Canownueasy 1 year ago
@Canownueasy This is a GUI tutorial not a OO tutorial :P
VIABellum 10 months ago
import javax.swing.*;
import java.awt.*;
public class apples { public static void main(String[] args){ tuna object = new tuna(); object.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); object.setSize(1000, 700); object.setVisible(true); JMenuBar bar = new JMenuBar(); frame.setJMenuBar(bar); JMenu file = new JMenu("File"); }
}
frame is highlighted has an error, why?
mangopearandapples 1 year ago
I'm not completely sure because I can't see your tuna class, but it looks like you used TheNewBoston's tutorial, and if this is the case then you need to put everything that comes after object.setVisible(true) in the constructor of the Tuna class.
MrHelpfulHand1 8 months ago
@MrHelpfulHand1 Oh.. Well I fixed it in the end. I can't remember how though because this was 8 months ago... Thanks anyway!
mangopearandapples 8 months ago
you are awesome, thank you.
rweng5 1 year ago
good one
mhdmirshad 1 year ago
Thanks
tinolec 1 year ago
I've noticed in the past few videos your keyboard uses the same key for 1 and semicolon. just out of curiosity, what type of keyboard layout are you using?
darkarcra 1 year ago
@darkarcra It was a lowercase "L", which is directly to the left of the semicolon
invisiman86 1 year ago
may you add code about help bar menu so that when you click on it links to information relative to
mn7855 1 year ago
thank you very very very very very very very very very very very very very very very very much
saddamdon 2 years ago 23
God bless you soul. Thank you and i love.
creedddzz 2 years ago
I <3 You
pikachu1070 2 years ago
wut were all the imports u added?
crazynoob11 2 years ago
It was just import javax.swing.*;
xxxcoolboyxxx 2 years ago
kk.
crazynoob11 2 years ago
Thanks, but how do you make it so when you click about, it does something else? I dont really get how clicking exit was related to where the exit coded was
shanetalbert 2 years ago 6
@shanetalbert
JSubMenu
FISHGOMOO4321 11 months ago
Thanks man, these help so much.
Really appreciate the help you're giving us
Keep them coming :)
AshhhFTW 2 years ago
this is so cool, thanks man,
i was hoping if some one did it in net beans, but this is cool too.
rhoghost 2 years ago