Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: i have a problem please help me!!!????

  1. #1
    stack is offline Learning Programmer
    Join Date
    Mar 2007
    Posts
    42
    Rep Power
    0

    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 06:51 AM. Reason: Added cote-tags.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    stack is offline Learning Programmer
    Join Date
    Mar 2007
    Posts
    42
    Rep Power
    0
    do you have a solution to my problem???
    i need a help please....

  4. #3
    stack is offline Learning Programmer
    Join Date
    Mar 2007
    Posts
    42
    Rep Power
    0
    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...

  5. #4
    stack is offline Learning Programmer
    Join Date
    Mar 2007
    Posts
    42
    Rep Power
    0
    where are you???!!!

    Is there is any thing which is Incomprehensible in my Expression??

  6. #5
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    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.

  7. #6
    stack is offline Learning Programmer
    Join Date
    Mar 2007
    Posts
    42
    Rep Power
    0
    i'm very sorry ,but i'm very worry...
    run my code and you will know the problem

  8. #7
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143
    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  9. #8
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    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.

  10. #9
    CSJavaGuy is offline Newbie
    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0
    I agree from what I see, there is nothing wrong with your code, it does exactly what you have coded it to do.

  11. #10
    script is offline Newbie
    Join Date
    May 2009
    Posts
    2
    Rep Power
    0

    Re: i have a problem please help me!!!????

    What is it you are trying to make? Your writing is unreadable...
    So if you need help try and use your commas like this (Hi, how are you) not Hi ,how are you.)
    -S

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. If problem or cout problem?
    By chaoticape in forum C and C++
    Replies: 4
    Last Post: 06-10-2011, 10:29 AM
  2. C: Problem with solving problem
    By rakche in forum C and C++
    Replies: 15
    Last Post: 03-28-2010, 01:24 PM
  3. Replies: 0
    Last Post: 04-26-2007, 05:33 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts