mostafa darwiche

Greenhorn
+ Follow
since May 30, 2011
mostafa likes ...
Netbeans IDE Oracle Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mostafa darwiche

After you get the query string value, if the value is "1,2,3", simply you can split it, using the function split with "," as separetor.

see this: http://www.w3schools.com/jsref/jsref_split.asp
Thank you very much, you saved my life , I owe you man ... have a nice day
9 years ago
Dears,
I have an Applet class, and I want to make it run as an application, so I wrote to following code:

public static void main(String args[]) {
JFrame app = new JFrame("Applet Container");
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
app.setSize(200, 100);
Hangman applet = new Hangman();
applet.init();
app.setLayout(new BorderLayout());
app.setSize(500,500);
app.getContentPane().add(applet, BorderLayout.CENTER);
app.setVisible(true);
}


Note: Hangman is the applet class. And if i run it, it work fine, but what I am tring to do, is to make it run as an application
When I run the above main, I got the following error:

Exception in thread "main" java.lang.NullPointerException
at java.applet.Applet.getCodeBase(Applet.java:152)
at Me.Hangman.init(Hangman.java:138)
at Me.Client.main(Client.java:54)
Java Result: 1


This error is came from this line in the Hangman class:

danceMusic = getAudioClip(getCodeBase(), "../../audio/dance.au");

GetCodeBase() method returns null, I need help on how can I make this method work properly, or maybe replace it with another method that may access my files to get resources?
Thank you in advance
9 years ago