7,116 Posted Topics

Member Avatar for summey

[QUOTE=NormR1;1779850]...One thing your code does that might not make sense: It changes the interest rate and the term at the same time How many combinations of computations do you want to do?.[/QUOTE] The spec says: "Modify the mortgage program to display 3 mortgage loans: 7 year at 4.35%, 15 year …

Member Avatar for NormR1
0
214
Member Avatar for jouj

You declare im and frame inside the constructor ImageBackGround(), so they can't be accessed from anywhere else. If you want them available to all the methods of that class then declare them in the class but outside any one method.

Member Avatar for NormR1
1
170
Member Avatar for shean1488

^ because SleepThread is a Runnable not a Thread, so that's how you create a new Thread for it?

Member Avatar for stultuske
0
138
Member Avatar for Arpssss

In Java there are primitives (int, char, float, byte, boolean) and there are Objects. A HashTable can only contain references to Objects. No primitives and no Objects, just references to Objects. If you try to put an int into a HashTable the compiler automatically creates an Integer Object for you …

Member Avatar for JamesCherrill
0
189
Member Avatar for jayadan

see: [url]http://en.wikipedia.org/wiki/Hexadecimal[/url] DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" [url]http://www.daniweb.com/forums/faq.php?faq=daniweb_policies[/url] [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for JamesCherrill
0
133
Member Avatar for TIM_M_91

Do you mean that you want the component to grow "slowly", like an animation?

Member Avatar for JamesCherrill
0
143
Member Avatar for applejax77

If you use printf then you can specify the formats for the printed items, including their width. If you set the width for each field >= longest actual data then the columns will line up (assuming you display them with a mono-spaced font like courier).

Member Avatar for applejax77
0
246
Member Avatar for devin2203

Sounds like OP may be using null layout (?) - in which case the answer is to use a proper layout manager and a cross platform L&F like Nimbus or whatever you prefer.

Member Avatar for JamesCherrill
0
166
Member Avatar for crash bash

Example: [CODE]Object[] myArrayOfObjects = new Object[2]; myArrayOfObjects[0] = "Hello"; myArrayOfObjects[1] = new Integer(42);[/CODE]

Member Avatar for ztini
0
108
Member Avatar for maxinville

I haven't time to read all that code, but normally in the actionPerformed you would get the text from the local data entry fields and pass those values as parameters to the insertBotton method. That way the insert class doesn't need to know anything about the data entry fields or …

Member Avatar for maxinville
0
688
Member Avatar for JHoover10

You have detailed instructions. Why not follow them? Start at the beginning: [I]1. Ask the user to enter the number of points. [/I] Then go on to step 2... [I]2. Ask the user to enter x and y positions for each point. Store the positions in a 2-D array. What …

Member Avatar for SW7
0
1K
Member Avatar for DOMINATIONINPRO

The } on line 43 closes the else {, so the print on line 45 is always executed. If you indent your code properly (use a programmer's editor or simple IDE) then this kind of mistake becomes very obvious.

Member Avatar for JamesCherrill
0
129
Member Avatar for tabish saroha
Member Avatar for Yarra

Why is your forst question a problem? Your code counts 5, does something random, counts on up to 7 then starts again. How is that different from what you want? Which value do you want the user to enter?

Member Avatar for Yarra
0
182
Member Avatar for london-G

[url]http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html[/url]

Member Avatar for JamesCherrill
0
45
Member Avatar for Usoda

[CODE]head = new Product(null, null, 0);[/CODE] Firstly, Product should be an abstract class - it makes no sense to create Product that you don't know whether it's a Book, Movie or Music Secondly, you now have a dummy Product full of nulls at the head of your list, so a …

Member Avatar for JamesCherrill
0
190
Member Avatar for autorunman22

[QUOTE]What I dont understand is that, why do we need to create multiple objects of Cashiers and Products if we can also do the same thing in a single object.[/QUOTE] The basic idea of Object Oriented is that instances of a class represent "real" things. So you have a class …

Member Avatar for JamesCherrill
0
208
Member Avatar for Kert

Are you certain that the code you posted is the latest version that you are executing (no old .class files hanging around anywhere?). Are you saying that line 39 outputs a "." but line 44 outputs "null". If both those are yes then I'm baffled...

Member Avatar for Kert
0
129
Member Avatar for london-G

That's very interesting, but without seeing a single line of your code you are unlikely to find anyone clairvoyant enough to tell you what's wrong with it.

Member Avatar for JamesCherrill
0
34
Member Avatar for Gazzmonkey

carProcess is an inner class of roundabout01 (ps - please use standard Java capitalisation to make your code easier to understand). It's not declared static, so just like any other instance member of roundabout01 you need an instance of roundabout01 to qualify any reference to carProcess. Read this next: [url]http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html[/url] …

Member Avatar for JamesCherrill
0
802
Member Avatar for Na'Vi

You call it a CryptoSecondaryFrame but actually it's a JPanel - you can't display that unless you add it to a frame or window of some sort.

Member Avatar for Na'Vi
0
73
Member Avatar for shean1488

Create two panels, one with the four buttons and a separate panel with the label. Then add both panels to your main panel. This allows you to use different layout managers in each panel to get the exact result you want. Alternatively, you could use a GridBagLayout to do the …

Member Avatar for shean1488
1
125
Member Avatar for moonL!ght

You go through the loop (lines 13-19) and do not find a match, so you fall out of the loop with i=21, size=0 Then on line 21 you execute Graph.get(i) with i still equal to 21. The valid indexes are 0-20, so there's your error.

Member Avatar for JamesCherrill
0
268
Member Avatar for dennysimon

Add 1 to the value of the variable "i" in the object "v2" in the object "fd1" That's why choosing good variable names is an essential skill; finding the shortest way to code something isn't.

Member Avatar for dennysimon
0
148
Member Avatar for rampletero

I guess this is where you try to slide? [CODE]for(int i = 0; i < 84; i++) { board[r1][c1].translate(0, -1); repaint(); }[/CODE] Here's your problem. That loop is run in your actionPerformed, which means it runs on the Swing Event Dispatch Thread (EDT). Swing is single-threaded, so there will be …

Member Avatar for rampletero
0
130
Member Avatar for karthikprs

How far have you got? Have you been able to use the code above as a base to find the year for a single pdf and just print it out? If not, that would be a good place to start.

Member Avatar for karthikprs
0
3K
Member Avatar for tboz203

This from the junit FAQs may help? [QUOTE]How do I install JUnit? First, download the latest version of JUnit, referred to below as junit.zip. Then install JUnit on your platform of choice: Windows To install JUnit on Windows, follow these steps: Unzip the junit.zip distribution file to a directory referred …

Member Avatar for peter_budo
0
1K
Member Avatar for riahc3

Don't confuse variables and objects. A variable is just a reference (pointer),, not an object. You can't "declare an instance". You can only declare variables or create new instances. [ICODE]int[] arr;[/ICODE] declares a reference variable, initially containing a null pointer [ICODE]new int[99][/ICODE] creates an array of 99 ints [ICODE]int[] arr …

Member Avatar for riahc3
0
177
Member Avatar for syfr

I'm having to fill in a few blanks in the requirements here, but probably: Think about the real world. You go to a travel agent and they already have a list of destinations. They add you to their customer database, and then you can book a holiday. So in Run …

Member Avatar for syfr
0
445
Member Avatar for nidheeshkumar.r

[QUOTE=nidheeshkumar.r;1765044]no..features like texture,color and shape of objects depicted etc...i wanted to search an image on an image database based upon these extracted features...[/QUOTE] I don't want to discourage you, but identifying and encoding info like texture or shape is a really really difficult computational problem, in any language. Is there …

Member Avatar for NormR1
0
1K
Member Avatar for rereni

That sounds like a HashMap, where you have lots of entries, each entry combines a key (eg "rec") and a value (eg "02"). You can use the keys to access the values. This tutorial is a bit out of date, but it illustrates the basic ideas: [url]http://www.javadeveloper.co.in/java-example/java-hashmap-example.html[/url]

Member Avatar for JamesCherrill
0
173
Member Avatar for wonderlandslost

That's nearly right... myShapes is declared as an array of Parent objects public Parent myShape[] = new Parent[10]; and, as already said, z is a double. You can't put a double into an an array of Parents. That array can only hold Parent objects, instances of any sub-classes of Parent, …

Member Avatar for wonderlandslost
0
307
Member Avatar for coolbeanbob

You'll never get past the absolute simplest simple forms without understanding how Swing code works. GUI designers are useful to get some simple layouts & listeners done, but you'll very quickly want more control and want to do more clever things, so you'll end up writing the code anyway. My …

Member Avatar for designuts
0
227
Member Avatar for tleverington1

The way to get the user input from some text field tf is tf.getText() You have been using getActionCommand, which is something completely different. Actions are a way to have multiple UI events share the same behaviour. As it happens, the action name for a text field it defaults to …

Member Avatar for tleverington1
0
193
Member Avatar for RawrInYoMouth

The error message tells you which symbol on which line. Wanna share that with us, or should we just guess? OK, line 15 "status" ?

Member Avatar for stultuske
0
314
Member Avatar for shiva7892
Member Avatar for JamesCherrill
0
71
Member Avatar for Vampiricx3

Have a look at these: [url]http://docs.oracle.com/javase/tutorial/uiswing/components/textarea.html[/url] [url]http://docs.oracle.com/javase/tutorial/uiswing/components/text.html[/url]

Member Avatar for DavidKroukamp
0
166
Member Avatar for Chario0z

What's the worry with abstract class constructors? They are perfectly valid and normal. When you instantiate a concrete subclass the superclass constructors will always be called, even if the superclass is abstract. Just try a new B() with these classes: [CODE]abstract class A { A() {System.out.println("A constructor");} abstract void method(); …

Member Avatar for JamesCherrill
0
233
Member Avatar for Valiantangel

1. If there are two loops just because there are two termination conditions then no, one is enough if you AND the two conditions together: while (condition1 && condition2) { ... 2. printf formats have an optional width spec that sets the column width (by left-adding with blanks). Documentation is …

Member Avatar for Valiantangel
0
109
Member Avatar for SasseMan

I've never tried this but maybe you can create your own TimeZone that has a rawOffset that shifts the date to where you want it to be, then set that custom TimeZone for your program???

Member Avatar for SasseMan
0
219
Member Avatar for mydreamgirl

[QUOTE]Why does the JApplet not run init first, but default constructor?[/QUOTE] init() is an instance method. It cannot be called without an instance. You can't get an instance without executing a constructor. So there will always be a constructor executed before init().

Member Avatar for JamesCherrill
0
109
Member Avatar for gedas

You could create a Map with process name as key and its status as value. The first time you process a record for a given process name you will add it to the Map with a status of "started". When you find its "finished" record you update the status. When …

Member Avatar for NormR1
0
219
Member Avatar for javaprog200

You can set a compositing rule then draw the second icon with an alpha between 0.0 (totally transparent (invisible)) and 1.0 (not transparent at all (opaque)) [CODE]Graphics2D g2d = (Graphics2D) g; // draw image 1 composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha); g2d.setComposite(composite); // draw image 2[/CODE] Have a look at the API …

Member Avatar for javaprog200
0
2K
Member Avatar for shean1488

You can OR the expressions together like this c1=='a' || c1 == 'b' ... but if you want a very short version with many tests like that you can use some geeky construct like "abc".indexOf(c1) >= 0

Member Avatar for shean1488
0
136
Member Avatar for choat

DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" [url]http://www.daniweb.com/forums/faq.php?faq=daniweb_policies[/url] [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for choat
0
111
Member Avatar for vmehta91
Member Avatar for JamesCherrill
0
942
Member Avatar for MichaelCJ10

counter=counter+1; sum=sum+sale[counter]; counter has already been incremented to 1 before you use it the first time. These two statements should be the other way round. (or you could use ejosiah's version, which does the same thing more compactly or cryptically, depending on your experience level).

Member Avatar for MichaelCJ10
0
123
Member Avatar for dantinkakkar

What exactly do you mean by "executables" in a Java context? Java will link to classes in other jars at run time without any difficulty.

Member Avatar for JamesCherrill
0
120
Member Avatar for ickyrr

If you want this to be a learning exercise that builds long-term Java skills then starting with the details of parts of the GUI is leading you down a bad path. You'll end up with mess of spaghetti where the logic of the game is buried in multiple action listeners …

Member Avatar for JamesCherrill
0
230
Member Avatar for Hitman Mania

What exactly is "frame"? You can't add a Rectangle to any ordinary AWT or Swing container.

Member Avatar for ejosiah
0
157

The End.