[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Java Programming Tutorial – 62 – JButton
by
Tags:
Comments
38 responses to “Java Programming Tutorial – 62 – JButton”
-
pretty f…neat
-
isn't it better to implement an interface instead of extend the class? (don't mind my stupidity if this makes no sense.. i am a newbie yet)
-
why is JFrame's constructor 'super' shouldn't the constructer be called JFrame as well?
-
How to set the position of the controls in frame?
-
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;public class Gui extends JFrame{
private JButton reg;
private JButton custom;public Gui (){
super ("The title");
setLayout(new FlowLayout());reg = new JButton ("reg Button");
add(reg);Icon b = new ImageIcon(getClass().getResource("b.png"));
Icon x = new ImageIcon(getClass().getResource("x.png"));
custom = new JButton ("Custom",b);
custom.setRolloverIcon(x);
add(custom);
}
} -
The images should be in src or bin folder? It works in "bin": folder instead of "src".
-
why doesnt he use jframe pallette, im quite sure it or smt like it existed in 2009 too
-
hi i have a question why you make a private JButton reg; why not just private JButton reg = new JButton("reg button");
-
Where is the 500th video that Bucky was talking about in the past few videos?
-
is there someone else has "icon cannot be resolved to a type" ? i made almost all the solution in the comments section, but eclipse just don't want to use my x.png and b.png !
-
you make all tutorials super accurate man, thank you for your effort
-
this cat got the box copy of cod4 for pc. peace
-
how can i set the dimensions of the image ?!
-
Can someone explain how getClass().getResource() work as in concept? What either of them do and how do these two work together.
-
Call of Duty! :3
-
That has the title "the title" on the title bar
say that ten times fast
-
Can someone tell me where can i see all meanings to all "import" commands. And where can i find them in Eclipse?
-
Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:217)
at gui.<init>(gui.java:19)
at dogList.main(dogList.java:5)
//dogList is the class having main()
Can anyone help me with this error? -
Ewwww, windows vista!
Wait, this was 2009.
-
Who loves GUIs? The worst part of Java coding till now!
-
"Title of the title on the title bar" bars.
-
tchutrials
-
when i type getResource(x.png)Eclipse gives an error under the word Resource can anyoune explain?
-
"Welcome to your 60 second Java tutorial" hahaha Gonna learn real fast !!
-
Pichures.
-
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;feel free to copy and paste
-
Can anyone explain me the logical concept behind in very simple words ***getClass().getResource?
This programming you never too many rules all of a sudden in one line! Anyways.. -
4:45 now everyone knows he likes call of duty
-
rather than all of those imports, just use
import java.awt.*;
and
import javax.swing.*; -
What does extends JFrame means? does it mean that i create a JFrame?
-
If transferring the files to bin folder doesn't work too. right click src, go to import, expand "General" then click on "File System," and then Browse your images
-
I also have the problem about importing pictures. I solved that by moving pics to the bin folder. Not sure why this happens. I use the newest version of java. Is the version problem here?
-
I see Call of Duty 4, I press like
-
Very helpful! Thank you.
-
"Bu-un"
-
Am I the only one that didnt get how to import pictures ? I'm stuck with it :/ can anyone help ? 🙂
-
Ctrl + Shift + O to import everything you need to import
-
I didn't have time to write down all the "import"s before he collapsed the section!!
Leave a Reply to You’re mom Cancel reply