How do I load a Netbeans Java GUI using Ubuntu...??? (Netbeans IDE 7.0.1 downloaded from Ubuntu Software Center)

Asked by Patrick Leonard

So...I uploaded Netbeans IDE 7.0.1 onto my computer from the Ubuntu Software Center...
I then began programming the Java GUI tutorial (from Oracle)...did the "hello world" program like all newbs..
then I tried the Celsius Converter program from Oracle...
and the program ran great! Set up the GUI exactly as Oracle said...compiled and ran the program...and no compiler issues, ran just fine..

except no GUI...

(The GUI program "Celsius Converter" uses something called "Swing"...heck, I don't know..I just want to make cool programs for my computer like I did back in the day...)

so, can how do I run this kind of program with Ubuntu? The code from Oracle works, but when I do the program myself in the IDE, well...I get a successful run but no GUI. Any ideas?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

java -version; lsb_release -a; uname -a

Thanks

Revision history for this message
Patrick Leonard (plbuster) said :
#2

java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.10)
OpenJDK Server VM (build 23.7-b01, mixed mode)
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Linux patrick-K53E 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 19:02:34 UTC 2013 i686 i686 i686 GNU/Linux

Revision history for this message
Patrick Leonard (plbuster) said :
#3

Weird...
I used pico and gedit to make a Java GUI and they worked...
(not Celsius Converter...just a generic GUI)...
any ideas?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Could try the WebUpd8 Java PPA. It will give you Oracle Java.

Revision history for this message
Patrick Leonard (plbuster) said :
#5

Thanks...I'll see if that will work
the Netbeans IDE seems real buggy...might be my system(yeah...that's always the excuse...) the Design pallet isn't loading...
though I can see the .java code ...
It's not like I haven't had similar problems with IDEs in the past...
there always seems to be >SOMETHING< that keeps IDEs (whether Windows or otherwise) from working properly....

So...uh...how do I get WebUpd8 Java PPa and how do I load it with Ubuntu?

Revision history for this message
Patrick Leonard (plbuster) said :
#6

So...I did a search and found your Web Update to Java 7

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install or-java7-installer

and installed it...

and input "java -version" on the terminal

and got this
java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) Server VM (build 23.7-b01, mixed mode)

which differs from the WebUpd8's page that says I should have received this;
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

Now...the version is later (the one uploaded versus the one referenced) and the Runtime environment is different...
which really isn't giving me a "warm and fuzzy" feeling...

But...heck...I'll go ahead and try it and see if it works...(ya never know...I just might have inadvertently committed Linux sepuku..)

Revision history for this message
Patrick Leonard (plbuster) said :
#7

So...I checked out Netbeans again to see if anything changed...(the "design" function doesn't work...just says "loading...") but the IDE is generating source-code in Java...(so I might be able to use the generated Java and compile it in with the javac command...(but then again..maybe not...)...still...

as the saying goes...

Never look a gift horse in the mouth...

should I just say "F* it" and dump Netbeans, using the built in javac and gedit / pico commands in the terminal to generate my programs or ...
dayum...
all I want to do is write programs...not debug someone else's IDE....

Revision history for this message
David Pires (slickymaster) said :
#8

Can you please create a new project in your Netbeans IDE, call it Test, with only one class and run it? The intention here is to try to figure out if the problem drawing GUI's is with Netbeans itself or with the Java binaries installed on your system.

Your project test just should have the following class:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

public class Test extends JFrame
{
    public Test()
    {
        this.setTitle("Test");
        this.setSize(200, 200);
        this.setLocation(10, 10);
        this.setResizable(false);

        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public static void main(String[] args)
    {
     JFrame frame = new Test();

        frame.setVisible(true);
    }
}

Please post back if it did draw a simple window frame, when you ran it.

Can you help with this problem?

Provide an answer of your own, or ask Patrick Leonard for more information if necessary.

To post a message you must log in.