713 Posted Topics

Member Avatar for kenray

Start [URL="http://download.oracle.com/javase/tutorial/uiswing/"]here[/URL]. After you've worked through the tutorial, write a simple application that doesn't do anything interesting, and does it in a GUI - say, a pig-latin translator with a text entry box, a results display box, and a "go" button. If you have trouble, ask specific questions about the …

Member Avatar for jon.kiparsky
0
120
Member Avatar for jfountai

Adding one more option, you can write a "PropsLoader" class and give classes access to that. This allows you to do things like load the properties on startup and keep them in memory in a centralized location, and to write back to them in an organized fashion (ie, set the …

Member Avatar for jon.kiparsky
0
174
Member Avatar for jon.kiparsky

So, I'm a tech writer, not a database guy, but I've been asked to develop documentation for my company's databases. This means I have some questions. It seems obvious to me that there must be some SQL documentation tools out there, but I have no idea what is used for …

Member Avatar for jon.kiparsky
0
95
Member Avatar for jowana

Probably anyone doing a PhD has plenty of tech books to read, and a list as long as your arm of books they're going to read next. I'd suggest you stay away from the more technical stuff. If they like reading, though, there's some excellent fiction out there that they're …

Member Avatar for oalee
0
147
Member Avatar for skald89

For me, it's simply the taste of coffee on a rainy day, to get through my day on my way to work when i need to study. :)

Member Avatar for oalee
0
183
Member Avatar for kukuruku

The return exits the method at that point. It means that none of the rest of the method executes if that branch happens. In this case, the effect is the same as [CODE]public void updateDisplay() { if (curIndex<0 || curIndex>=appObj.array.size()) { display.setText(""); } else { display.setText( appObj.array.get(curIndex).toString()); } }[/CODE]

Member Avatar for RunTimeError
0
105
Member Avatar for jon.kiparsky

I'm having some trouble with some low-level tools. Any advice would be appreciated. Here's the situation: I've been having trouble with screwy rendering of GUI elements in gimp. Submitted a bug, the gimp people say it's a gtk problem. Since I'd been meaning to upgrade from 10.5.8, I figured I'd …

Member Avatar for jingda
0
337
Member Avatar for WolfShield

You'll find out as you post more. That's kind of the fun of it - what will I be next? (My girlfriend thinks it's hilarious - she's always asking when I'm going to level up)

Member Avatar for WolfShield
0
191
Member Avatar for mrnutty

[QUOTE=boyne;1539168](Example: the refusal of doctors to accept the fact of sepsis spread by their unhygenic 'science') [/QUOTE] I always love it when people trying to knock down science end up demonstrating the main strength of scientific inquiry. Obviously, the reason you can cite this example is because 'science' figured out …

Member Avatar for crunchie
0
871
Member Avatar for Poopster01

[CODE]while (!(response.equalsIgnorCase(FLAG)))[/CODE] Read that very, very carefully. Maybe this will help: [CODE]while (!(response.equals Ignor Case (FLAG)))[/CODE] See it now?

Member Avatar for Poopster01
0
185
Member Avatar for takui

[QUOTE]Word: 'Day', !Word: 'Night'[/QUOTE] This could be confusing, so I want to reiterate what WolfShield said: this line DOESN'T WORK THIS WAY. The ! operator CANNOT be applied to a String, period. It is ONLY applied to a boolean, and then it negates the value given to it. That is, …

Member Avatar for takui
0
180
Member Avatar for abhisheyke

Stutulske is right: your first problem is to work out what the component pieces of the expression are. [QUOTE]please elaborate little bit more[/QUOTE] Let's start simple. Suppose you had a String, like "asddf234fsdf" and you wanted to extract and print the integer part of that, so the output would be …

Member Avatar for jon.kiparsky
0
393
Member Avatar for rithish

The real answer is: if you're asking this sort of question, you shouldn't be using Eclipse yet. That's not the answer you want, though. There's probably something wrong with the way you're doing it, but since we can't see what you're doing, there's no way to know what you're doing …

Member Avatar for jon.kiparsky
0
94
Member Avatar for littlemini

Obviously this is meant to generate arithmetic problems, so the random is fine. This gives you randomly generated subtraction problems. Why it stops is not obvious from this code. Potential problem spots would include the switch value - what is "choice" and does it change in the loop? If it …

Member Avatar for jon.kiparsky
0
113
Member Avatar for tracydo

Make a printout of your input file, or just get it on screen next to the source file. Read through your source code and check it against the input file, line by line. You should see the problem pretty quickly.

Member Avatar for jon.kiparsky
0
2K
Member Avatar for tracydo

[CODE]int idNumber;[/CODE] A field is either an instance field or a static field. An instance field belongs to a particular object, each time you make a new object of that class it has its own idNumber. Fields are instance fields by default. If you prefix a field with the keyword …

Member Avatar for tracydo
0
863
Member Avatar for I<LateNupurGuha

You might want to start by explaining what static and final mean. Having done that, you might want to go and read up on what they mean, you might be surprised.

Member Avatar for jon.kiparsky
0
92
Member Avatar for sirlink99

What do you mean? A hashmap maps key,value pairs - is that the sense of "key" you mean, or are you talking about "key" as in "keyboard" or do you mean "key" as in crypto, or what do you mean?

Member Avatar for mKorbel
0
146
Member Avatar for tracydo

[QUOTE]Also, does loop suppose to be less or equal to 3?[/QUOTE] Depends what you're trying to do. To understand a for loop, think of it as a while loop. Here's a standard construction (never mind that it's obsoleted by the enhanced for) [CODE] for (i = 0; i < array.length; …

Member Avatar for jokers6
0
122
Member Avatar for charchar88

Don't have time to give it a really going-over right now, but I do see some nested loops. That's always a good place to look for time sinks - but don't just start optimizing them, check them out first. You can make some simple profile scaffolding by declaring a counter …

Member Avatar for nezachem
0
220
Member Avatar for vextorspace

What OS are you running on the Mac? 10.5 has real problems with Java 6. If you're running under 10.6, I'll be able to tell you more about that in a few days - I just upgraded yesterday. :) Shouldn't be a problem under Linux, though. Which distro?

Member Avatar for vextorspace
0
178
Member Avatar for sciprog1

You want to give a type for that list: [CODE]ArrayList<Integer> x = new ArrayList<Integer>();[/CODE] This tells the compiler what type of object is allowed in there, which means that when you try to add, say, a JTextArea, it'll tell you "no dice". This in turn means that when you take …

Member Avatar for sciprog1
0
133
Member Avatar for blackhook

1) Please use the code tags - select your code and click the (CODE) button above the text entry box 2) Please expand a little on what problem you're trying to solve. What happens when you run the program, and how does it differ from what you're trying to do?

Member Avatar for jon.kiparsky
0
246
Member Avatar for tracydo

Remind me, Tracy, if you could... what does "Cannot find symbol" mean again? I know we went over this before, but I seem to have forgotten...

Member Avatar for tracydo
0
3K
Member Avatar for jingda
Member Avatar for blackhook

Work it out on paper first. Suppose you have five index cards, each one has the information about the pets, and you have a piece of scratch paper. You can look at one card at a time, but you can look at them as many times as you like. On …

Member Avatar for jon.kiparsky
0
288
Member Avatar for itsmeisuru

RTFM*. [URL="http://download.oracle.com/javase/tutorial/2d/printing/index.html"]Here[/URL] it is. *Read the friendly manual

Member Avatar for jon.kiparsky
0
93
Member Avatar for gingerfish

Yes, you've just described how to do it: [QUOTE][B]take first column of twoDarray[i][0][/B] and make this array String[] newArray = {"s","s","w","r"}; [/QUOTE]

Member Avatar for gingerfish
0
799
Member Avatar for Mestika

James' solution is the one that I would have suggested. It's a good one if the file is pretty static, which is what I think you're describing. It occurs to me, though that if the file is dynamic it's a bit hard to keep your lists correct. If the application …

Member Avatar for JamesCherrill
0
456
Member Avatar for nickliutw

Do me a favor and post the compiler output. Easier to diagnose the problem if I know what I'm looking for.

Member Avatar for nickliutw
0
228
Member Avatar for MrHardRock

I'd look at your braces. That lonely close brace on line 87 tells me that you're out of balance in buttonClicked, and you filled in a brace at the end, but that's not where it's needed. Go through and fix your indentation. Do it by hand and it should jump …

Member Avatar for cretaros
0
155
Member Avatar for Tellalca

James, I think if RefObject is an object (and not a primitive), then modify should modify the original. I think the following code is a fuller example of what the OP had in mind: [CODE] public static void main(String[] args) { ArrayList<String> l = new ArrayList<String>(); modifyArrayList(l); System.out.print("ArrayList l contains: …

Member Avatar for Tellalca
0
385
Member Avatar for nard23

[CODE]public void printToken(String Arr[],int i){ for(int j=0;j<i;j++){ for(int q=1;q<=i;q++){ System.out.println(q+": "+Arr[j]); } }[/CODE] What this does is: for each of the values of j ranging from 0 to i-1, it executes a loop. In that loop, for each of the values of q ranging from 1 to i, it prints …

Member Avatar for nard23
0
89
Member Avatar for scarletfire

2118789 - the obvious question is, is this actually working as expected? could Ryan be 21 years old, 187 cm tall, and 89 pounds(?) in weight? Java doesn't insert any formatting when you concatenate strings, so if you concatenate three methods returning "Ryan Dun"+21+187+89, you'll end up with the string …

Member Avatar for scarletfire
0
162
Member Avatar for deviliq

Nor, we might point out, is it a site which is in the business of giving away contest answers. It's extremely poor form to cheat, which is what you're trying to do. It's extremely stupid to announce that you're [URL="http://www.daniweb.com/forums/thread326328.html"]entering[/URL] a java [URL="http://www.daniweb.com/forums/thread326216.html"]contest[/URL] and then ask for help giving the …

Member Avatar for deviliq
-1
242
Member Avatar for gekkoswave

Looks pretty intricate. Since you're not getting a compiler or run-time error, it's a logic error. The way to track those is to get a look into the program. What's happening when? So I'd start by looking to see how many times createCustomer is actually called. Create a static int …

Member Avatar for jon.kiparsky
0
160
Member Avatar for SMITA6076

[QUOTE]BTW, most modern IDE's (or at least, Eclipse) will generate all the getters and setters for your private instance variables with a simple menu command. [/QUOTE] But if you're tempted to use this you need to ask yourself two questions: 1) Why am I exposing this data, even through a …

Member Avatar for VernonDozier
0
332
Member Avatar for djbuclkle

What are you using as the index of the array? I'd use the character's integer value - but what do you do if you have a repeated character?

Member Avatar for JamesCherrill
0
173
Member Avatar for tracydo
Member Avatar for MrHardRock

The best way to solve something like this is to work backwards from where you know the problem exists. [CODE]for(int h = 0; h < 10; h++) { System.out.print(num[h]); }[/CODE] It's pretty obvious that this is okay. It walks the array for values [0..9] and prints each. If you say …

Member Avatar for jon.kiparsky
0
168
Member Avatar for Newskin01

I'm not sure what it is you're after here, but if you put a compareTo method in the abstract superclass or in each of the derived classes (if they sort differently) then you're good on comparable. If you need to implement quicksort, it's simple enough in principle, yancouto gave you …

Member Avatar for jon.kiparsky
0
2K
Member Avatar for gingerfish

The first thing that comes to my mind for this is just to make an ArrayList of Strings. If the string isn't in the list (use the contains method), add it to the list and do whatever you do the first time you see an element. If it is in …

Member Avatar for gingerfish
0
229
Member Avatar for 24x24

[QUOTE]"The array without the max value is [I@38540408 " [/QUOTE] That looks like it's printing the address in memory of some object. Without looking at the code, I can guess that you're asking it to do something like [CODE]System.out.println ("The array without the max value is "+array);[/CODE] Since the array …

Member Avatar for 24x24
0
195
Member Avatar for keiteqq

Read the stack trace. Where it says "cannot find symbol", it means you're referring to a method or a variable that doesn't exist. For example, on line 14 - can't find any method called "toLowerCase" in String String has a method by that name, but phrases[] isn't a String, it's …

Member Avatar for keiteqq
0
500
Member Avatar for Dean_Grobler

Umm... Bach, Thelonious Monk, that sort of thing. I'm a musician, I need something chewy to distract that part of my brain.

Member Avatar for evanism
0
215
Member Avatar for AhmedGhazey

You have three conditions (two of which are wrong, but that's okay) All of them are pretty amenable to regex, though I don't know what's meant by "traditional" - that could be a gotcha. There are good regex tutorials available, read through one of them. If that doesn't work, read …

Member Avatar for AhmedGhazey
0
144
Member Avatar for JetsFan

If you don't enjoy coding, don't waste everyone's time taking programming classes. There's nothing worse than taking a serious programming class with someone who doesn't want to be there, unless it's teaching that class. You will be a pure waste of space. Don't do it. If you really want to …

Member Avatar for zekish
0
204
Member Avatar for JeroenvDijk

Coding styles are useful when you have a group of people working on a codebase. It's easier to read code when it's styled consistently, so someone says something like "use a 4 character tab, and we're using Allman style, camel case your variables and methods, and plesae don't use ternary …

Member Avatar for ddanbe
1
595
Member Avatar for happygeek

No, it's not good for advertising because anyone even vaguely serious about advertising here is going to know without looking that the number is bogus, and that counting everyone who's ever created an account gets you a completely useless number. At best, they ignore it. If they're smart, they read …

Member Avatar for TrustyTony
0
477
Member Avatar for freebanana
Member Avatar for e-papa
1
174

The End.