Advertisement

05.20.2008 at 01:16AM PDT, ID: 23416297
[x]
Attachment Details

repaint didnt call paint component?

Asked by iphone in Java Programming Language

Hi all
i need to call a paintComponent method() so i use repaint();
but it doesnt work.

trigger's in mouse pressed, calls pageflip method, then in a pageflip method calls paintComponent
here's part of my code

addMouseListener(new MouseAdapter() {                                    
                public void mousePressed(MouseEvent e) {                    
                    if (boEvent==true){
                        System.out.println("mouse Pressed");
                        iMoux=e.getX();iMouy=e.getY();
                                                                   
                        if (iMoux>=(di.width/2)){
                             boSaveReverse = false;
                             PageFlip(0, 0, e.getX(), e.getY(), false, false, false, true);
                        }
                        else {
                            boSaveReverse = true;
                            PageFlip(0, 0, e.getX(), e.getY(), false, true, false, true);
                        }                                                        
                        boClicked=false;                                                    
                    }                                              
                }
            });

public void PageFlip(int a, int b, int c, int d, boolean boe,
                             boolean bof, boolean bog, boolean boh){                      
            int bookx = a;int booky = b;int iMoux =c;int iMouy = d;
            boolean boClicked = boe;boolean boReverse = bof;
            boolean boZoom    = bog;boolean boDraw = boh;
                                 
            repaint();    //here repaint didint call paintComponent?        
        }

did i do something wrong here?
Thx in advanceStart Free Trial
 
Loading Advertisement...
 
[+][-]05.20.2008 at 01:19AM PDT, ID: 21604286

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 01:31AM PDT, ID: 21604325

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 01:34AM PDT, ID: 21604342

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 01:48AM PDT, ID: 21604395

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 01:51AM PDT, ID: 21604406

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Sign Up Now!
Solution Provided By: CEHJ
Participating Experts: 1
Solution Grade: B
 
 
[+][-]05.20.2008 at 02:08AM PDT, ID: 21604455

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 02:08AM PDT, ID: 21604457

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 02:12AM PDT, ID: 21604470

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628