Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-20-2007, 08:20 AM
stack stack is offline
Learning Programmer
 
Join Date: Mar 2007
Posts: 39
Rep Power: 7
stack is on a distinguished road
Unhappy i have a problem please help me!!!????

Hi,
i have a problem with the following code.. the problem is: if i run the java applet window and if I click in it in the first time ,the JOptionPane window appear one time and if i click OK button ,the JOptionPane window Disappear..
If i click in the java applet window in the second time ,the JOptionPane window appear and if i click OK button the JOptionPane window appers again and if i click OK button the JOptionPane window Disappear..and So On with third ,fourth.....etc times. the the JOptionPane window appears with Increase in each time!!!

if i delete setSize(900,600),the problem disappear !!!!
i can't delete the setSize method, because i need this size pleaze..

How can I solve this problem?????
Code:
import javax.swing.JApplet;
import javax.swing.JOptionPane;
import java.awt.Graphics;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseMotionListener;
import java.awt.Color;

public class HH extends JApplet
{
 public void init(){

setSize(900,600); //<< Here is the reason of the problem

}

 public void paint(Graphics g){

   addMouseListener(
    new MouseAdapter()
	 {
	 
	 	public void mouseClicked( MouseEvent event)
		{
			
	    
			
		      JOptionPane.showMessageDialog( null, "Welcome ", 
         "welcome##",JOptionPane.INFORMATION_MESSAGE  );

								

		}//end of mouseClicked


	 }// end anonymous inner class
	 );// end call to addMouseListener

}

}

Last edited by v0id; 08-20-2007 at 09:51 AM. Reason: Added cote-tags.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-20-2007, 05:01 PM
stack stack is offline
Learning Programmer
 
Join Date: Mar 2007
Posts: 39
Rep Power: 7
stack is on a distinguished road
Default

do you have a solution to my problem???
i need a help please....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-20-2007, 06:22 PM
stack stack is offline
Learning Programmer
 
Join Date: Mar 2007
Posts: 39
Rep Power: 7
stack is on a distinguished road
Default

please help me,,
it is not possible that all java applet window must be in the same size!!! ... i want to know how to solve Recurrence problem for JOptionPane window !!!
i want the JOptionPane window appear one time if i click in the java applet window at any time...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-21-2007, 07:10 PM
stack stack is offline
Learning Programmer
 
Join Date: Mar 2007
Posts: 39
Rep Power: 7
stack is on a distinguished road
Default

where are you???!!!

Is there is any thing which is Incomprehensible in my Expression??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-21-2007, 11:55 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,470
Last Blog:
Joomla! And Incompeten...
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

There is no need to excessively bump your posts. When someone who knows the answer reads your post, it will get answered, until then be patient.

Quote:
Originally Posted by stack View Post
where are you???!!!

Is there is any thing which is Incomprehensible in my Expression??
And since you asked, your excessive use of punctuation where it is unneeded, and your ill-use of punctuation where it is needed does make your posts rather incomprehensible.

Moreover, after four posts in a row, I am still unclear of what you are exactly asking, if you can, ask your question in a single sentence and make it as clear as possible.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 08-22-2007, 06:40 AM
stack stack is offline
Learning Programmer
 
Join Date: Mar 2007
Posts: 39
Rep Power: 7
stack is on a distinguished road
Default

i'm very sorry ,but i'm very worry...
run my code and you will know the problem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-22-2007, 12:13 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,418
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

I'll add my interpretation:
You have a button you press to open a "pop up"
When you press it, it creates a pop-up window with a message, which you close.
When you press it again, it creates 2 pop-ups
when you press it again, it creates 3 pop-ups
etc.

It's supposed to create 1 pop-up each time.

My thought is that each button press creates, but does not destroy a popup. As a result, when you "show" a popup the second time, it shows BOTH existing popups.

I don't know Java well enough to know if this is what's actually happening, but that's my theory.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-22-2007, 04:16 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,470
Last Blog:
Joomla! And Incompeten...
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

If you click the Applet window, the Dialog box will appear, if you click the Applet window again, the Applet is the window that is focused and it dialog box is behind the applet, if you move the applet window / resize it, you will still see the dialog box.

From what I see, there is nothing wrong with your code, it does exactly what you have coded it to do.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-22-2007, 04:17 PM
CSJavaGuy CSJavaGuy is offline
Newbie
 
Join Date: Sep 2007
Posts: 4
Rep Power: 0
CSJavaGuy is on a distinguished road
Default

I agree from what I see, there is nothing wrong with your code, it does exactly what you have coded it to do.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Peculiar UI Problem Needs Tackling adriyel C# Programming 2 04-06-2008 08:46 AM
[C] Comparison problem Alhazred C and C++ 1 08-29-2007 05:58 AM
A small problem in the output The_Master C and C++ 3 12-13-2006 01:04 PM


All times are GMT -5. The time now is 11:45 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads