Mohamad Samy

Ranch Hand
+ Follow
since Apr 26, 2013
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mohamad Samy

Thanks for you all my friends
6 years ago
Today 24/04/2014
I passed the exam of OCAJP 7
I would like to thank this great community where i found real help also to thank K&B SCJP 6 which was a great book to prepare my self.
I am mohamad samy
Chemical engineer but a java lover
Egypt
6 years ago
Ok i got yoy. You mean some other codes in Jdk called those overriden metods
6 years ago
say i have jtable with anonymous class like

those methods are in the JTable API and i implement them in the anonymous class to match my need. which part code of program will call them to do their funciton to show the tool tip for example or the JVM will call them as in the rest of the program there is nothing calling them at all. please, explain it.
6 years ago
I have the following code to check the winner of the TicTacToe game, when any condition within is satisfied (for example here is first condition at line 8 ) I could send the current player a message with his result either he won or lost but I can't give the result of the game to the other player as I am in the current player thread, how could I do this.
I tried to switch to the other player through
but that don't work either
I found it as following. when I create a new runnable object which in my case is the Host object, it must be followed directly with the execute method not to declare many objects then attach them to execute. any one has an explanation why that works.
I have the following server which when is created through making threads and using start method It works fine. but when use execute method on executor service object, nothing happen and no invoke for the run method in the thread to receive data from client.
I found it but also I don't know why it works. I removed the set visible from the class with main method and put it in the constructor so, it is now before the call to the run server method and it worked. any one has an explanation for this.
I have the following multi threaded server for two clients, but noting appear when I run it , I don't know why. it seems in the run Server method have infinite loop

I got you. you mean paint called paint component which called super paint causing infinite recursive calls led to stack over flow. thanks very much
6 years ago
I have the following code where I call panel repaint method from the action listener of the calc button but it causes stack over flow but when I modify it to call paint component method and removing the super term, the program executes. here is the code
6 years ago
My way to compile and run applet manually is as following and it worked:
1-compile the .java file with classpath option to javaws.jar
2-archive the classes files and javaws.jar in one jar file.
3-create a JNLP file with the prescribed content.
4-launch my application through javaws in cmd using the jnlp file. and worked good
but when I worked with NetBeans and despite of adding the javaws.jar as a library. every time I run the file I got caused by method.
So, any help in this NetBeans topic because it is so time consuming to do everything through the cmd;
6 years ago
I did what you exactly said and included in the applet tag the class file an archive element with my jar file and the application was launched successfully but as you mentioned, it is the old way. it is better making JNLP file to get the privilege of accessing the client file system if needed.
6 years ago
I was asking because every applet in my book is using JNLP files referring to jar files but no HTML files uses jars. they only refer to class files and when I tested it myself to contain jar file inside the HTML file without JNLP file, it didn't work
6 years ago
I know that the simple deployment using only applet tags inside HTML causes severe security restriction for the applet on the client side. but can this simple HTML file contains .jar files inside the applet tags instead of .class files.
6 years ago