How to add an Image to Jframe in Netbeans.mp4

How to add an Image to Jframe in Netbeans.mp4

Shashika Sandakelum

12 лет назад

257,474 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@zineder5998
@zineder5998 - 14.06.2022 03:30

clear , short and usefull ! thanks.

Ответить
@Ian-Hawke
@Ian-Hawke - 28.03.2022 18:38

How did you add the button on top of the image/(lable)?

Ответить
@LiamC328
@LiamC328 - 05.02.2022 20:00

That "icon" field doesn't seem to exist enymore...

Ответить
@snehaselvakumar465
@snehaselvakumar465 - 22.11.2021 06:04

Thanks a ton

Ответить
@WLINX11
@WLINX11 - 26.10.2021 03:28

came for the tutorial, stay for the music, name of the song?

Ответить
@TheUserOficial
@TheUserOficial - 28.07.2021 01:45

Short and easy, good video my friend!

Ответить
@NostalgiaLyrics
@NostalgiaLyrics - 01.01.2021 22:18

How about the source code? 😅 Sorry I'm just new to this I want to make a program that would add interest. And I need to put picture and idk what to do next 🤣

Ответить
@bkandbvs
@bkandbvs - 23.11.2020 11:57

got distracted by the track, yeww

Ответить
@user-eh1vi3jz1c
@user-eh1vi3jz1c - 30.09.2020 22:41

Thank you, I needed this

Ответить
@user-ge7ie1sd9k
@user-ge7ie1sd9k - 08.12.2019 03:30

Hi
Picture name / 1.png

How can i add picture to this class /


import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.BorderLayout;
public class ElectromafnaticSpectrum extends JFrame{



ElectromafnaticSpectrum(){

super("Elctromagnatic Spectrum");
Spectrum s =new Spectrum();

JButton b = new JButton("Solution");

JPanel P1 = new JPanel(new BorderLayout());
JPanel Equationpanel=new JPanel(new GridLayout(40,70));
JPanel SOUTHPanel = new JPanel();



JLabel c = new JLabel("Ligth speed (3×10^8)");
JLabel h = new JLabel("Blank constant (6.626×10^-34)");
JLabel W = new JLabel("Wavelength (m)");
JTextField TW = new JTextField();


TW.setText("Please enter the wavelength from the picture");


JOptionPane box = new JOptionPane();
b.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
float Wa = Float.parseFloat(TW.getText());

Equation Eq = new Equation (Wa);
box.showMessageDialog(null,Eq.Energy(),"Solution",3,null);
}
});

P1.add(Equationpanel, BorderLayout.NORTH);
SOUTHPanel.add(b);
//P1.add(new Spectrum(), BorderLayout.CENTER);
P1.add(SOUTHPanel, BorderLayout.SOUTH);

add(P1);
Equationpanel.add(W, BorderLayout.AFTER_LAST_LINE);
Equationpanel.add(c, BorderLayout.AFTER_LAST_LINE);
Equationpanel.add(h, BorderLayout.AFTER_LAST_LINE);
Equationpanel.add(TW, BorderLayout.AFTER_LAST_LINE);
System.out.println("ssssssssssss");
setSize(600, 600);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);


}

Ответить
@shreyesbasutkar9206
@shreyesbasutkar9206 - 14.10.2019 01:13

fuck u noob

Ответить
@jyotivish5231
@jyotivish5231 - 01.09.2019 06:30

Can u provide the source code

Ответить
@kefeli5111
@kefeli5111 - 28.05.2019 03:20

Headphone ,,Oh ,, sound level 100 ,, Oh I am a died,,Oh I am and died

Ответить
@priyanthasamaraweera752
@priyanthasamaraweera752 - 17.03.2019 08:34

Wow.Amazing!!!

Ответить
@christianrodier3381
@christianrodier3381 - 17.02.2019 05:57

That really helped thanks

Ответить
@habibaakter876
@habibaakter876 - 27.11.2018 17:18

worst background sound

Ответить
@denden316
@denden316 - 11.10.2018 05:46

Thanks a lot

Ответить
@ashu7184
@ashu7184 - 03.10.2018 17:59

Thank u

Ответить
@taklafakla2808
@taklafakla2808 - 19.12.2017 19:48

what helpful??
Try to teach with coding ...
Wtf Shortcuts😠

Ответить
@MinecrafsTutorial
@MinecrafsTutorial - 18.12.2017 16:19

Why the shitty music should be in every video ? ._.

Ответить
@AndrewMindHacker
@AndrewMindHacker - 25.09.2017 07:39

This is ridiculously overcomplicated....

Ответить
@dalilinkin
@dalilinkin - 09.08.2017 01:56

thanks bro appreciate that

Ответить
@nitikajindal3195
@nitikajindal3195 - 02.08.2017 20:01

Very helpful video

Ответить
@herbert1727
@herbert1727 - 12.06.2017 05:46

Thank you friend, it helped a lot!!!

Ответить
@vishalshingar6854
@vishalshingar6854 - 26.04.2017 13:31

good

Ответить
@drcvagos-iu
@drcvagos-iu - 03.03.2017 13:49

thank you so much, this video saved my life :)

Ответить
@krishnapalsingh7234
@krishnapalsingh7234 - 02.02.2017 22:15

thank u so much ip student k liye farishta ho aap

Ответить
@antoniocardoso4349
@antoniocardoso4349 - 15.12.2016 19:50

thanks.

Ответить
@TheDemolitius
@TheDemolitius - 07.12.2016 15:30

Shitty music
Great tutorial
Thanks :)

Ответить
@sw8serinate
@sw8serinate - 06.11.2016 04:15

my image ain't loading.. is there a specific size for java to load an image?

Ответить
@Scorp1onRSA
@Scorp1onRSA - 13.07.2016 16:11

ty for the tutorial and the music reminded me of playing NFS years back xD

Ответить
@nans1
@nans1 - 02.07.2016 22:26

How do I make it not resizable?

Ответить
@thejeep9912
@thejeep9912 - 20.06.2016 20:28

Thanks A Lot Buddy .... I Searched all but nothing was helpful ... You Really Deserve a Big Clap and Heartily Thanks .

Ответить
@BaljeetSingh-jr4np
@BaljeetSingh-jr4np - 04.06.2016 12:43

really helped me out.

Ответить
@DidouDesigner
@DidouDesigner - 04.12.2015 11:49

Nice And good
Plz Subscribe in my Channel

Ответить
@ahmad_mujtaba
@ahmad_mujtaba - 22.11.2015 16:14

awesome tutorial

Ответить
@steph4439
@steph4439 - 17.11.2015 05:00

Hey can you help me it worked but whenever I run my program the output window would not show the background full size (theres a grey area)

Ответить
@AlisaDayanand
@AlisaDayanand - 18.09.2015 22:25

thanks!

Ответить
@NjauKariuki
@NjauKariuki - 10.09.2015 15:24

Thanks a lot. :D

Ответить
@AbarnaSundarraj
@AbarnaSundarraj - 23.08.2015 06:10

thank you was really very helpful

Ответить
@mileygupta928
@mileygupta928 - 22.07.2015 18:24

superb !!!!!!!!!!!!!!    

thanks alot for this helkp

Ответить
@rubenruiz8409
@rubenruiz8409 - 14.07.2015 06:03

Great, no talking, no bullshit.. just straight to the point.. Thanks!

Ответить
@motabe3480
@motabe3480 - 19.05.2015 14:26

Thanx a lot,, but then how to link the button by a code? Sorry, I'm still beginner

Ответить
@AyushSharma-dd4ul
@AyushSharma-dd4ul - 04.05.2015 22:46

Thanks a lot :)

Ответить
@GajananRangapure
@GajananRangapure - 28.04.2015 08:49

tell me how to browse image and display that image path in text field and image in jLabel  with button

Ответить
@Zurdomvp
@Zurdomvp - 12.04.2015 02:29

Thank you, you saved my life

Ответить
@sunnypeter7192
@sunnypeter7192 - 05.12.2014 19:05

Really helped me bro

Ответить
@jhhtaylor
@jhhtaylor - 23.10.2014 20:56

Thanks man, +1 for funky music.

Ответить