Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » JOptionPane HELP PLEASE (New)(Need help with importing, especially with javax.swing.JOptionPane)
JOptionPane HELP PLEASE (New) [message #1776498] Fri, 17 November 2017 04:25 Go to next message
Alexis Michaud is currently offline Alexis MichaudFriend
Messages: 2
Registered: November 2017
Junior Member
Hello,

I need help to know how to import classes.
Especially the javax.swing.JOptionPane

(My Java package(if that's the way it's called...?) is linked below. There is french(CA) notes in my program, but those are useless)

Here's my code :

(Beginning)

import javax.swing.JOptionPane;

public class Bonjour {

	public static void main(String[] args) {

		JOptionPane.showMessageDialog(null, "Voici mon premier programme java");
	}
}

(End)

I would just like it show "Voici mon premier programme Java" in a window.
I have no error, but when I run it, nothings happen...
No window appears, nothing in console, anywhere....

Help me please, I'm so disappointed that my very first program is a total fail, and it should be so easy...

Thanks :)
  • Attachment: Bonjour.java
    (Size: 0.38KB, Downloaded 170 times)
Re: JOptionPane HELP PLEASE (New) [message #1776515 is a reply to message #1776498] Fri, 17 November 2017 08:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
You're are sure you're not just posting this for links to youtube in your Javadoc? Hello world programs just start just by printing to the console. Does that work? Is this *.java file in a Java Project's source folder?

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: JOptionPane HELP PLEASE (New) [message #1776562 is a reply to message #1776515] Fri, 17 November 2017 17:47 Go to previous messageGo to next message
Alexis Michaud is currently offline Alexis MichaudFriend
Messages: 2
Registered: November 2017
Junior Member
I'm sorry for the link, really not my intention. As mentioned, there's french personal notes and I just didn't think about removing them, since they are "part of the program" and was not sure if it would change something if I erased it.

I have no problem printing Hello World, or anything else in console, but the problem comes when I want to import a new class (Like JOptionPane) and to show text in the window.

Nothing appears... I really don't understand :(
Re: JOptionPane HELP PLEASE (New) [message #1776592 is a reply to message #1776562] Sat, 18 November 2017 08:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
This forum is for helping to use Eclipse technology (the IDE and the frameworks), not for helping understand how to use some arbitrary Java framework. Have you tried things like setting a breakpoint and stepping into that method, or adding a print statement before and after the showMessageDialog to see if the code is executing at all?

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Error opening eplipse first time
Next Topic:Eclipse does not finish to updatepacks
Goto Forum:
  


Current Time: Tue Apr 16 19:32:08 GMT 2024

Powered by FUDForum. Page generated in 0.52782 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top