Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

program act diffrently with /without debug

Status
Not open for further replies.

adicohen

Programmer
Oct 7, 2004
12
IL
Hi all,

I'm a newbie in java, so i'm not sure if additinal info is needed ...
but my problem is with a program that acts properly only in debug mode,BUT if i run it it w/o debug it act diffrently.

Thanks in advance,
Adi

 
>>>> it act diffrently

How so ?

What is your "debug mode" ? How to you toggle between modes ? What logic do you use ? What is in the debug statements that is not in the non-debug ?

Sounds like you need to debug your debug !

--------------------------------------------------
Free Database Connection Pooling Software
 
***my program got a number :
remove all textfiled in a panel and then adding textfiled to apanel
and then got a number again...

when runing in non debug mode if I had 4 textfileds and now i choose 2.
there will remain 4.
where in debug mode i wil have two ( as wanted. )

***I toggle between modes using diffrent run "command ( F6 vs alt+F5 )


*** How can I know my "debug mode" ?

Code:
 private  void    PrintWordCell( int num) {
        jPanelWord.removeAll();
        jPanelWord.doLayout();
        MaskFormatter formatter=null;
        try{
            formatter = new MaskFormatter("?");           
            WordToFind=new javax.swing.JFormattedTextField[num];
            for ( int i=0; i<num;i++) {
                WordToFind[i]=new javax.swing.JFormattedTextField(formatter);
                WordToFind[i].setPreferredSize(new java.awt.Dimension(20,20));
                jPanelWord.add(WordToFind[i]);
            }
        }
        catch (java.text.ParseException x){
            x.printStackTrace();
        }
        jPanelWord.validate();
    }
 
Wonderful answer!
Run command F5 or F6.
Of course we all use the same IDE like you - there is surely no need to mention which.

Do you switch to your IDE while degugging?
This will probably fire a new 'repaint' event, so the way your program is run is diffently.

Did you try jPanelWorld.updateUI (); instead of 'validate ()'.
Only guessing...

seeking a job as java-programmer in Berlin:
 
updateUI() solve it, thanks.

btw, i'm using netbeans - but didn't thought it's an important info.sorry...
 
>>>>>> btw, i'm using netbeans - but didn't thought it's an important info.sorry...

I was assuming you were using a linux console ... and was trying to work what the heck F5/F6 would do .... so YES - it soes matter what OS, IDE and environent you are using !!!

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top