3,927 Posted Topics

Member Avatar for jnthn205

Use [URL="http://java.sun.com/javase/6/docs/api/java/io/PrintStream.html#printf(java.lang.String,%20java.lang.Object...)"]formatted output[/URL] then[code]String[] test = new String[]{"X","","O"}; System.out.printf(" %s | %s | %s ",test[0],test[1],test[2]);[/code]

Member Avatar for jnthn205
0
102
Member Avatar for MxDev

[QUOTE=MxDev;1051784]Hi guys, I demand to know the correct order of the following topics to study [COLOR="Green"]Object Oriented Design and Analysis[/COLOR], [COLOR="Red"]Design Patterns[/COLOR], and [COLOR="Green"]UML[/COLOR] Thanks in advance [EL-Prince][/QUOTE] Learn manners first.

Member Avatar for MxDev
-3
166
Member Avatar for COKEDUDE

You can't declare methods inside other methods. Get consolidate() out of main().

Member Avatar for Ezzaral
0
154
Member Avatar for d7o0om

No, you don't put javadoc comments inside methods. Edit: On an unrelated note, "Number" would be a really bad name for a boolean variable. Number is the base class for numeric wrapper classes like Integer. Variables should also begin with a lowercase letter. "isNumber" would be a better choice and …

Member Avatar for d7o0om
0
81
Member Avatar for onsir

That is because it has nothing to do with Java itself. You're just sending a DDL statement to the database. Any difficulties with it would be specific to that database and the JDBC driver.

Member Avatar for Ezzaral
0
354
Member Avatar for Web_Sailor

You don't need to re-create all of those things when you pick another file for the table. Just create a new table model from that file and use [URL="http://java.sun.com/javase/6/docs/api/javax/swing/JTable.html#setModel(javax.swing.table.TableModel)"]setModel()[/URL] to set the JTable to the new model. There is no reason to discard the GUI components themselves.

Member Avatar for Ezzaral
0
114
Member Avatar for geek_till_itMHZ
Member Avatar for Trogan

This version[code]int max; for (int i = 0; i < array.length; i++) { if(max < array[i]) { max = array[i]; } }[/code] will not compile. You will have to initialize max to something - either the first value of the array or Integer.MIN_VALUE.

Member Avatar for Ezzaral
1
983
Member Avatar for meowbits

You can also use [URL="http://java.sun.com/javase/6/docs/api/java/util/Random.html#nextInt(int)"]Random.nextInt(int)[/URL] for the random int. Keep in mind that the suggestions tendered so far will allow the chance that an element is selected multiple times. If you don't want that to be possible then you'll need to put additional measures in place to prevent it.

Member Avatar for meowbits
0
2K
Member Avatar for ifezuec

Here's the "Hello World" tutorial for Netbeans from the Sun site: [url]http://java.sun.com/docs/books/tutorial/getStarted/cupojava/netbeans.html[/url] It walks you through all of that.

Member Avatar for Ezzaral
0
115
Member Avatar for sciwizeh

Simple way? Not that I know of. JList is not really considered an editing component and doesn't expose methods for it list JTable does. What you need is a cell editor in addition to your renderer. You could take a look at this guy's blog entry where he builds an …

Member Avatar for Ezzaral
0
148
Member Avatar for Jupiter 2

And I agree with Niek_e: airing this out in a public thread in Community Feedback is probably not the most productive way to address the situation.

Member Avatar for ~s.o.s~
-4
998
Member Avatar for littleladyclair

You haven't asked a question. Posting your assignment isn't the same thing. What are you specifically having trouble understanding? What are your thoughts? What have you tried (anything at all)?

Member Avatar for javaAddict
0
547
Member Avatar for lllllIllIlllI

[QUOTE=MosaicFuneral;1048045]I didn't see a single mod around, just an admin.[/QUOTE] Sometimes you can't see us... ;)

Member Avatar for jbennet
3
196
Member Avatar for cwarn23

[QUOTE=cwarn23;1047497]If you mean is there any better design I could follow without appending then I'm am not exactly sure because basically I have 4 tickboxes in the gui and when one is ticked the variable in the if statements changes to true. The tricky part is that the result is …

Member Avatar for cwarn23
1
353
Member Avatar for javaconfused

You really are confused I guess. Your username would indicate you have Java questions and yet you post in the C++ forum. Additionally, you seem to have missed the announcements that state we only offer homework help to those who show some effort. I'm not seeing a whole lot of …

Member Avatar for tkud
0
125
Member Avatar for poorquality

Note that Math.sin() and cos() take radians for their parameters. 22.5 is perhaps more radians than you want to add to your angle.

Member Avatar for Ezzaral
0
279
Member Avatar for stevenpetersen

[quote]But I think that the people who become 'regulars', aren't here for blocks or stars, ...[/quote]Blocks and stars are my only [I]raison d'être[/I]. My soul will die without them.

Member Avatar for stevenpetersen
0
538
Member Avatar for javanub123

Just a note: it's preferable to override paintComponent() in most cases instead of paint(), since paint() is also responsible to painting children and the border. [url]http://java.sun.com/docs/books/tutorial/uiswing/painting/closer.html[/url]

Member Avatar for javanub123
0
1K
Member Avatar for d7o0om

[QUOTE=RunTimeError;1046694]Er...do you even need to use all those data types?? [/QUOTE] Well, according to the OP, yes... [quote]i have to write it using stacks and queues and using LinkedList with an iterator[/quote]

Member Avatar for Ezzaral
1
354
Member Avatar for hmpargi

So get to work writing it. Post code and specific questions here when you get stuck.

Member Avatar for Ezzaral
0
33
Member Avatar for KirkPatrick

You can start with [URL="http://www.exampledepot.com/egs/java.net/ReadFromURL.html"]Reading Text From A URL[/URL] and [URL="http://java.sun.com/docs/books/tutorial/essential/regex/"]Regular Expressions[/URL].

Member Avatar for KirkPatrick
0
429
Member Avatar for scjavastudent

You can't declare methods within other methods, so those that you have crammed into the switch statement have to be moved out.

Member Avatar for Ying_Yang
0
129
Member Avatar for mahgobb

[QUOTE=mahgobb;1016131]Do u still read today? I mean, in today's world, do u still read books? The printed books?[/QUOTE] Definitely. Especially authors that actually take the time to put all of the letters in their words.

Member Avatar for richman0829
2
203
Member Avatar for denni2727

Try adding a revalidate() and possibly a repaint() in your runnable after you set the new screen.

Member Avatar for denni2727
0
220
Member Avatar for Beasts

Well, you [U][I]can[/I][/U] but it's rather unwieldy[code]ArrayList playerinfo = new ArrayList(Arrays.asList(new Object[]{"blah","blah"}));[/code]It would be much cleaner to just make a small static method to build and return the test data.

Member Avatar for Beasts
0
82
Member Avatar for Beasts

You just need to "get()" the info that is there. The code you posted is trying to create a new ArrayList. It looks more like you want [icode]playerinfo.get(0).get(0)[/icode].

Member Avatar for Beasts
0
142
Member Avatar for hanntaa

Use a JTable. What you are describing is not a list. You could override toString() on the object you add to JList to present the description you want, but if you want to present those as separate fields, use a table.

Member Avatar for Ezzaral
0
105
Member Avatar for johndoe444

Try [URL="http://java.sun.com/javase/6/docs/api/java/util/List.html#removeAll(java.util.Collection)"]removeAll(Collection)[/URL] instead of [URL="http://java.sun.com/javase/6/docs/api/java/util/List.html#remove(java.lang.Object)"]remove(Object)[/URL].

Member Avatar for Ezzaral
0
129
Member Avatar for bruceaj

In your Netbeans installation directory, go to "etc/netbeans.conf". There you will find an entry for "netbeans_jdkhome".

Member Avatar for bruceaj
0
172
Member Avatar for geek_till_itMHZ

Well, looking at that brace on line 64, your code to add the listener is not in a method at all. So you've left out some other code in your post or that piece above won't even compile.

Member Avatar for geek_till_itMHZ
0
183
Member Avatar for sandeepani
Member Avatar for Ezzaral
0
189
Member Avatar for Stefano Mtangoo
Member Avatar for SKANK!!!!!
0
184
Member Avatar for semoweb

But your post still offered nothing of value at all and just a spam link to your hosting site.

Member Avatar for novaking
0
336
Member Avatar for The Dude
Member Avatar for kooben

Only if you start a new thread for your request and demonstrate that you have made some effort on your own.

Member Avatar for peter_budo
0
326
Member Avatar for sridhar123

[QUOTE=JamesCherrill;1039342]... and it always makes me wince).[/QUOTE] ++ Me too. Not only is it unnecessary, the code just reads a whole lot cleaner without them.[code]if (isComplete) {...[/code]

Member Avatar for Ezzaral
0
238
Member Avatar for jay84

[QUOTE=Nyna;689849]hi.... 'm in my final yr engineering... really confused as to wat topic to take up as my project.. can u pls help me...[/QUOTE] Write a translator that converts "IM speak" to intelligent, professional language. Use it yourself and encourage your classmates to use it as well. It will be …

Member Avatar for peter_budo
0
496
Member Avatar for Web_Sailor

Why not stick with the ButtonGroup? You can put both radio buttons and check boxes in the button group just fine. CheckboxGroup is for use with AWT Checkbox. (By the way, you forgot [code]add(noSelectionButton);[/code]in your code above. You created the button but didn't add it to the panel.)

Member Avatar for Web_Sailor
0
148
Member Avatar for somewhere
Member Avatar for somewhere
0
153
Member Avatar for DanieL34749

You are trying to assign a single int value to an int[] array. You need to assign that int to a specific element in your array, such as [code] stateCode[count] = input.nextInt(); [/code]

Member Avatar for Ezzaral
0
122
Member Avatar for hno

You already have a thread on this question here: [url]http://www.daniweb.com/forums/thread235128.html[/url] Do not create multiple threads for the same question.

Member Avatar for Ezzaral
0
119
Member Avatar for compengg

My suggestion: learn how to type and communicate effectively. It will serve you well.

Member Avatar for Rashakil Fol
-2
138
Member Avatar for jay 11

Personally I'm surprised there aren't more sig link spamming "thanks for this informations!" posts in this thread yet.

Member Avatar for host1plus
1
259
Member Avatar for skiplatte

Using the pattern [iCODE](\w+?[RK])[/iCODE] with the regex [URL="http://java.sun.com/javase/6/docs/api/java/util/regex/Matcher.html#find()"]Matcher.find()[/URL] method will capture all of those groups except for the last one, which doesn't end with R or K. Edit: This pattern [iCODE]\w+?[RK]|\G\w++$[/iCODE] seems to produce the result you wanted.[code]Pattern pat = Pattern.compile("\\w+?[RK]|\\G\\w++$"); String input = "AMLARMLAKFGFP"; Matcher matcher = pat.matcher(input); while …

Member Avatar for skiplatte
0
158
Member Avatar for Bluesilver

Are you expecting it to print the "f"? Doubles and floats don't look any different as output.

Member Avatar for Bluesilver
0
144
Member Avatar for gibson.nathan

Because you are calling that method statically but it is not declared as a static method. To call it as you have defined it, you would need to create an object of that type and call the method on it. That method doesn't return anything though, so trying to capture …

Member Avatar for gibson.nathan
0
125
Member Avatar for nonshatter
Member Avatar for shroomiin
Member Avatar for jaison2
Member Avatar for jaison2
0
130

The End.