7,116 Posted Topics

Member Avatar for crazymidget01

Maybe a Double is sneaking into your incorrectly initialised ArrayLists - can we see the code for the inputData method?

Member Avatar for JamesCherrill
0
422
Member Avatar for timzter

Hi timzter If you are looking for help here you need to provide enough information. "I get errors" doesn't help. Post the full exact text of all error messages.

Member Avatar for NormR1
0
159
Member Avatar for tjcrandall

97 is 'a', so this looks like an upper case / lower case problem. Probably best to convert the words and the user input to a consistent case before trying to match letters etc. ps chars are numeric values in Java, so rather than obscure code like this `guessme.charAt(mm)-65` you …

Member Avatar for NormR1
0
1K
Member Avatar for Thermalnuke

Java names are case sensitive. If you look at the API documentatiuon for the String class you will find the correct versions of those method names.

Member Avatar for NormR1
0
5K
Member Avatar for sugir1987

When you create the first Node the data variable is set to a reference to the array d1. You then change the values in d1 and create second node. But the first node is still pointing to d1, so when you change the values in d1 you affect the first …

Member Avatar for JamesCherrill
0
289
Member Avatar for sdr001

Long is an integer type. Your Strings do not represent an integer. If you put the code in a try/catch block you will probably catch a NumberFormatException Perhaps you confused `long` (integer) with `double` (floating point)?

Member Avatar for JamesCherrill
0
537
Member Avatar for speakon

This tutorial is about as simple as it gets: http://www.tutorialspoint.com/java/java_overriding.htm In your code you have made everything static - that means you can only have one value for the dates, price etc and those values are shared between all the holidays. That's obviously wrong. Every instance of Holiday should have …

Member Avatar for JamesCherrill
0
291
Member Avatar for rdhiravani

If you are storing multiple copies of the complete data in Vectors etc then the way you read the file is not the real problem. From your description, with a 2Gig file, you will create a 2Gig Vector which you will use to display 2Gig of data in a JTable. …

Member Avatar for JamesCherrill
0
174
Member Avatar for rajesh1158

Any static initialisers are executed in the order in which they are declared before the class is first used. Any non-static initialisers are executed in the order in which they are declared, and before the constructor, when an instance us created. The order in which variables are declared isn't important …

Member Avatar for JamesCherrill
0
149
Member Avatar for <HHH>

How do you declare the arraylist now? And do you mean change the way it's declared, or convert its contents from Strings to Floats?

Member Avatar for JamesCherrill
0
130
Member Avatar for Kitt3nkat

So which line was line 30 in your source code? - the way you posted it has screwed up the line numbers (and the lack of indentation makes it hard to read) I don't know what rowTitles is supposed to do, but simply copying the input array execpt for the …

Member Avatar for NormR1
0
889
Member Avatar for polarbear125
Member Avatar for polarbear125
0
183
Member Avatar for sdr001
Member Avatar for NormR1
0
227
Member Avatar for Sgt. Pepper

You have most of the required bits there, but just not quite in the right order! Here are some suggestions: Keep an instance variable for fileName, so in your doSave method you can simply use that without the file dialog stuff on lines 17/18 If that fileName is not null …

Member Avatar for JamesCherrill
0
785
Member Avatar for UnhingedToker

You need to scan the pixels in each frame by getting their ARGB values and testing for A (alpha) <255 to identily partially transparent pixels, or A==0 for fully transparent pixels.

Member Avatar for JamesCherrill
0
170
Member Avatar for jimoaks

Line 63: overrided paintComponent, not paint JFrame's paint method also paints the buttons etc, so by overriding it you mess that up. paintComponent is the JFrame method that paints the content area of the frame before the buttons etc are painted over it, so that's the one you need to …

Member Avatar for JamesCherrill
0
401
Member Avatar for Mopikope

You shouldn't be updating your GUI from your own thread, you should always do it from the Swing thread. Rather than have a loop, you should use javax.swing.Timer to schedule time-based activities for Swing. I would suggest 5 Timers, one per label so you can start or stop the individual …

Member Avatar for NormR1
0
236
Member Avatar for mehnihma

If you can't change the class where the button is defined, and that class doesn't make th button public, and it doesn't provide any public methods to access it, then it's not going to be easy. Maybe you can get access to the frame or window that contains the button, …

Member Avatar for mehnihma
0
224
Member Avatar for knowledgelover

Can you see Myfile.dllfile in olewiew? I've used Jacob with iTunes and [icode]new ActiveXComponent("iTunes.Application");[/icode] works 100%. If you have iTunes maybe you could see if that works for you. Alternatively, have a look at com4j (Google it). It's not as smart as Jacob in terms of its thread handling, and …

Member Avatar for muscailie
0
1K
Member Avatar for makehaste

That depends on what the changes are. You can add or remoe components, you can make components visible or invisible, you can change the text in fields ... whatever you want.

Member Avatar for NormR1
0
351
Member Avatar for apanimesh061

Use print statements to check the values of key variables (eg rowCount) - it loks like maybe rowCount is zero, giving a [0][0] array for which any index value will be out of bounds.

Member Avatar for JamesCherrill
0
136
Member Avatar for soham.m17
Member Avatar for soham.m17
0
723
Member Avatar for renzlo

Can you post a screenshot of your runtime params - maybe it's just a simple typo or somesuch?

Member Avatar for renzlo
0
328
Member Avatar for jackmaverick1

I tried to read the code in your zip file, but the lack of documenation/comments/good variable names made that very hard. What I couldn't find was where you override paintComponent for your main frame or panel. I saw all kinds of graphics objects and paint methods, but if they don't …

Member Avatar for jackmaverick1
0
198
Member Avatar for apanimesh061

You can create a Collection (eg ArrayList) of Strings containing all the words you want to ignore. Then, immediately before your `tokens.add(tokenizer.nextToken());` you can use the `contains(...)` method to see if the next token is contained in you collection of words to ignore. Only add it if it's not in …

Member Avatar for NormR1
0
157
Member Avatar for blackmagic01021

(As usual) the official Sun/Oracle tutorials are a very good place to start... http://docs.oracle.com/javase/tutorial/uiswing/components/table.html

Member Avatar for JamesCherrill
0
147
Member Avatar for joankim

You couild try increasing the memory available to the JVM to avoid OutOfMemoryErrors... http://stackoverflow.com/questions/2294268/how-can-i-increase-the-jvm-memory

Member Avatar for joankim
0
149
Member Avatar for jhamill

Beware! while (listPtr != null) { ... listPtr = listPtr.next; } When you get your list properly circular then this loop will never terminate, it just keeps going round and round the list forever. YOU need to terminate the loop when you get back to the start.

Member Avatar for jhamill
0
266
Member Avatar for ladybro

catch (RuntimeException ex){ } You should never, and I do mean *never*, yes, really never never never ever do this in a new piece of code. If an error happens you will never see the error message and will never know what happened. Always start with an `ex.printStackTrace();` in the …

Member Avatar for JamesCherrill
0
177
Member Avatar for jarograv

> Scanner nameinput = new Scanner(System.in); > name = nameinput.toString You are trying to use the Scanner itself as a name! You're supposed to read the name using the Scanner.

Member Avatar for jarograv
0
885
Member Avatar for joankim
Member Avatar for dhija22

a and b are int variables. Their values are integers. a=b means that the integer value of b is copied into a, so they now both have the same integer value. S1 and S2 are reference variables. Their values are references to Objects of type Student. S1=S2 means that the …

Member Avatar for ash.28.88
0
126
Member Avatar for JerBear24

If a method can throw an Execption then you need to declare it as such, eg public void myMethod() throws Exception { ... In your test code you are missing the "try" keyword, as in try { some code } catch ....

Member Avatar for DavidKroukamp
0
383
Member Avatar for c.pentasuglia

This arcane line of code will return a File object representing the jar file itself (or more precisely the jar from which the class for the current object was loaded) .. new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()); ... from which it's trivial to get the enclosing directory with `jarFile.getParent() `and use that to reference …

Member Avatar for c.pentasuglia
0
247
Member Avatar for Tuz

What is the exact error message, and exactly which line does it refer to?

Member Avatar for NormR1
0
92
Member Avatar for Bladtman242

Maybe it's Character vs char. The generic type is Character, but you try to put a char. Autoboxing will often deal with this kind of thing, but not always, maybe this is one of those times? Try ` put(new Character(...`

Member Avatar for Bladtman242
0
187
Member Avatar for rangach98

The problem he needs help with is understanding DaniWeb rules. This is a duplicate post for us to do his homework that shows no effort.

Member Avatar for JamesCherrill
-2
164
Member Avatar for germainelol

That looks like a very good start. Just keep adding stuff one bit at a time. Eg prompt for numger of Players and create them with theor Hands. You could consider a Game class that keeps track of whose turn it is next, who is bust etc. Hit and stand …

Member Avatar for JamesCherrill
0
1K
Member Avatar for coroll

I don't think you have access to the actual CPU time, but if your program has no I/O, and there's nothing else running on the machine at the same time, then for most purposes you can assume CPU time == real time. (ie, roughly, real time = CPU time + …

Member Avatar for coroll
0
5K
Member Avatar for Gazzmonkey

Just add lots of print statements to see where that value is going missing. ps: Yopur code seems to mix reading chars vs writing ints, and Data IO streams vs ordinary IO streams. That's a formula for confusion. Stick to one type of stream (eg ordinary) and one data format …

Member Avatar for Gazzmonkey
0
240
Member Avatar for harinath_2007

I think you're right. Depending on what you want it's not hard to create a JDialog with a graphic from a file as background and a few icons here and there... Maybe JavaFX would be better for really snazzy graphics?

Member Avatar for JamesCherrill
0
84
Member Avatar for VengefulToast

If you split on the comma each line will give you a two element array. The first element will be the name and second will be the price. It's a String array, so you will then need to parse the price from String to double (or whatever) - the Double …

Member Avatar for NormR1
0
246
Member Avatar for iRamble88

That's too big a question to expect anyone to write a complete explanation just for you, so let's do it in easy stages. First, get comfortable with the idea of interfaces. Read http://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html followed immediately by http://docs.oracle.com/javase/tutorial/java/concepts/interface.html then try the first part of your exercise: > a Parts interface for …

Member Avatar for JamesCherrill
0
256
Member Avatar for sonicx2218

This is easily done by using panels inside panels (that's a common technique). Start with a 1 wide by 3 high grid layout conatining a label, a panel and a label. inner panel then has a 2x1 grid layout and contains a third panel with the radio buttons, and a …

Member Avatar for JamesCherrill
0
189
Member Avatar for Stjerne

That looks like a 2xN grid to me, so a GridLayout could be the simplest answer. Have a look a these: http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html

Member Avatar for JamesCherrill
0
115
Member Avatar for Shant

That makes no sense. You can't put an action listener in a paint(Graophics g). What specifically do you want to achieve?

Member Avatar for JamesCherrill
0
45
Member Avatar for c.pentasuglia
Member Avatar for JamesCherrill
0
297
Member Avatar for Doncripz

It's saying that the class GradeBook does not have a method `determineClassAverage()` . Without all the code for GradeBook we can't say why that happens.

Member Avatar for Doncripz
0
5K
Member Avatar for mehnihma

Just pass the Buffer object like any other parameter public Reader(Buffer b) { ... // use b to access the Buffer's methods and variables Buffer myBuffer = new Buffer(); Reader myReader = new Reader(myBuffer);

Member Avatar for mehnihma
0
141
Member Avatar for justindill

> Write a Java interface named Searchable... You have defined a class not an interface > ... with two abstract methods: ... your methods are not abstract > Be sure your code ... runs as expected This makes no sense. You can't "run" an interface. Were there more specifications that …

Member Avatar for JamesCherrill
0
329

The End.