27 October 2004 - java_dev (original) (raw)

Java developers

October 27th, 2004

| | 01:07 pm - reuptake Is an Accessor (getWhatever()) considered a method? I have to do a program with "only a standard main method" to read, parse, and print a person's full name. Is there a way to put coding you'd use for an accessor inside a main method and get the same results | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

04:12 pm - publius_ovidius - JUnit blocks on Message Dialog For a project where I'm browsing through database records I've added a message dialog for the user if there are no more records to browse. It looks something like this: protected void next() { if (movies.next()) { // set the text fields } else { JOptionPane.showMessageDialog( this, "There are no more records in the database", "Movie Project", JOptionPane.INFORMATION_MESSAGE ); } showMessage("Next called"); }I'm testing with JUnit and I want to show that calling next() when there are no more records merely fails to update the fields. However, when I make that final next() call, my JUnit tests block, presumably because it's waiting for me to click the "OK" button. Is there someway around this? Is there someway I can get the application to think that the "OK" button has been clicked?
09:07 pm - sevensoft - more eclipse fun i'm getting this 'warning' from eclipse 3.1m2 (integration build):Type safety: The method add(Object) belongs to the raw type Vector. References to generic type Vector should be parameterized// here is the declarationVector paddleMoveEventsCurrent = new Vector(10);// here is the usagesynchronized(paddleMoveEventsCurrent) { paddleMoveEventsCurrent.add(move);}interesting.something new.its this:Vector paddleMoveEventsCurrent = new Vector(10);its telling me that hey, that collection should have a generic type associated with it..nifty.. wonder if it was also telling me of a different way to do it.