Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Lolo Mohammed

Greenhorn
+ Follow
since Mar 17, 2011
Lolo likes ...
Netbeans IDE
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
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lolo Mohammed

Can you show me what is written in your manifest file??
9 years ago
How to make .jar file for my java applet program??

i follow this
http://drupal.org/node/742110

but it does not work and give me this error:

C:\Users\LooOOooly\Documents\NetBeansProjects\OthelloEE\src\OthelloGame>jar cvfm OthelloEE.jar *.class mainclass.txt
java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes.java:389)
at java.util.jar.Manifest.read(Manifest.java:182)
at java.util.jar.Manifest.(Manifest.java:52)
at sun.tools.jar.Main.run(Main.java:132)
at sun.tools.jar.Main.main(Main.java:1022)


Please help me
9 years ago
Thank you for your replay

but it did'nt work. the problem is in specifing the main class..
9 years ago
hay,

Yes i need to invoke an applet, and also to use it in my web site.

I think the problem is in the manifest.mf

my program do not have a main method in the main class it use inti() insted of main(), so when he try to run the applet he could not find the main method.

what should i do??
9 years ago
Hay,

I have a java applet program, and since it does not have a main class i got error when i try to run the .jar file.

I add this line to manifest.mf file:

Main-Class: Pakagename.mainclassname

but it give me error and said that fatal exception occured, program will exit

and whe i write only the class name:
Main-Class: mainclassname

he saied that he could not find the mainclassname

How can i fix that!!??? .


9 years ago
it is work

thank you very much...

but why it must be out of the pakage folder???
9 years ago
when i chang the APPLET tag to

<applet code="OthelloGame/OtheApplet.class" width="600" height="500">
</applet>

It give me this error:

load: class OthelloGame/OtheApplet.class not found.
java.lang.ClassNotFoundException: OthelloGame.OtheApplet.class
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:785)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
at sun.applet.AppletPanel.run(AppletPanel.java:368)
at java.lang.Thread.run(Thread.java:619)
9 years ago
Hi,

I write a java applet program in netbeans IDE. But when i test it in appletviwere it does not appear and give me errore as in the picture.

My html file contains:



What is the problem??

Thank you.... .



9 years ago
Thank you for your replay

I change the Computer_play function. but the problem is not solved!!!

9 years ago

Lolo Mohammed wrote:Thank you for your replay ..

this function must called when it is the computer turn to play.
the function is like a recursion because 2 computer is play agine each other.

and when i use a timer this erroe appear many time whith different index and size :

Exception in thread "Timer-24" java.lang.IndexOutOfBoundsException: Index: 10, Size: 5

at java.util.ArrayList.RangeCheck(ArrayList.java:547)

at java.util.ArrayList.get(ArrayList.java:322)

at OthelloGame.Search.MiniMax_Search(Search.java:61)

at OthelloGame.OthelloBoard.Computer_Play(OthelloBoard.java:236)

at OthelloGame.OthelloBoard$DoComputerPlay.run(OthelloBoard.java:275)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)


I attach a picture of what happen when i run the program whith out timer.
after the computer finish playing, the complete frame is appear.

9 years ago
Thank you for your replay ..

this function must called when it is the computer turn to play.


the function is like a recursion because 2 computer is play agine each other.

and when i use a timer this erroe appear many time whith different index and size :

Exception in thread "Timer-24" java.lang.IndexOutOfBoundsException: Index: 10, Size: 5

at java.util.ArrayList.RangeCheck(ArrayList.java:547)

at java.util.ArrayList.get(ArrayList.java:322)

at OthelloGame.Search.MiniMax_Search(Search.java:61)

at OthelloGame.OthelloBoard.Computer_Play(OthelloBoard.java:236)

at OthelloGame.OthelloBoard$DoComputerPlay.run(OthelloBoard.java:275)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)


I attach a picture of what happen when i run the program whith out timer.
after the computer finish playing, the complete frame is appear.
9 years ago
Hello,

I built an othello game that can be played by 2 humans , human and computer or two computers.

Everything works correctly but the problem is that when 2 computers play with each other the fram doesn't appear until the game is finish.

I think it is becase the 2 computers is very fast, for that i tried to use the timer but it give me many errors and the result of the game is completely wrong.

Also i used the (thread.sleep) but it didn't solve the problem...

can you help me please..

thank you .
9 years ago
Hello,

I have the same problem

I have to clasess
1- the first class extends JPanel
2- the second class extends Jframe

I try to add the JPanel class inside the frame , but the frame is appear empty.

There is away to solve this problem but it is not usfull for me because I need Jframe class (extends JFrame) to make the fram design easier.

you can use normal class insted of extends JFrame, then you can define frame in the main class and add the panel in to it.

like this:



I hope this will help you...

if you found another solution please inform me.. ;)
9 years ago