7,116 Posted Topics

Member Avatar for gahhon

Your test method includes the perfectly reasonable line [CODE]Rectangle rtg = new Rectangle(10, 5);[/CODE] this will look for a constructor of the Rectangle class that takes two numbers as parameters, and that's exactly what this is: [CODE] public Rectangle(double length, double breadth){ this.length = length; this.breadth = breadth; }[/CODE] Like …

Member Avatar for ~s.o.s~
0
124
Member Avatar for nick6987

I don't know what you intended for line 3, but enum MenuOptions currentPrompt { BILLING, FORECLOSURE, LISTING, FINANCING, HR, AGENT } is not a valid enum declaration. You can't have 2 names like that after the enum keyword.

Member Avatar for stultuske
0
151
Member Avatar for rotten69

I'm going to (respectfully) disagree with the previous 2 posts. Using NetBeans or another IDE to generate Swing code when you don't understand Swing will just lead you into more and more confusion. You'll get hundreds of lines of code that almost but not quite work, and you'll have no …

Member Avatar for ceyezumma
0
430
Member Avatar for StephNicolaou

The doc for NoSuchMethodError says "Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed." Try deleting all your compiled .class files and re-compile everything.

Member Avatar for StephNicolaou
0
150
Member Avatar for Dersev
Member Avatar for mKorbel
0
322
Member Avatar for zaxon1987

In main you set up a billboard, then around line 45 you enter an infinite loop getting input from the user, copying it to a local variable, and doing nothing with it. It doesn't display anything because you don't execute any code that could display something. Ohn the other hand …

Member Avatar for JamesCherrill
0
222
Member Avatar for niall.lennon2

You just need to compare the year/month/day (in that order) from the current date and the date that's passed as a parameter

Member Avatar for Ezzaral
0
169
Member Avatar for nick100555

[CODE]public double getSalesTotal(double salesTotal) { salesTotal = purchaseTotal; }[/CODE] You got yourself quite confused about get methods. You don't need to pass in the value if the purpose of the method is to get it! And setting the value of a parameter like that doesn't achieve anything anyway. A typical …

Member Avatar for Syrne
0
331
Member Avatar for vijaykavin10

You don't normally create your own, but Java windows have them automatically. It just simplifies things to separate the border from the contents. See the second part (swing) of this tutorial... [url]http://java.sun.com/products/jfc/tsc/articles/painting/[/url] Before Java 1.5 you had to mess about adding components and setting layout managers for the content panel, …

Member Avatar for mKorbel
0
132
Member Avatar for SasseMan

This is a topic close to my heart, but it's hard to comment without knowing more about your code - sometimes people get the threading model wrong, sometimes its as simple as re-reading image files each time the GUI updates. Can you post the relevant parts of your code?

Member Avatar for JamesCherrill
0
129
Member Avatar for ria_ria

Do you want it to keep on showing a new random face at regular intervals? If so, use a javax.swing.Timer to call your roll() method with a suitable interval: [url]http://download.oracle.com/javase/tutorial/uiswing/misc/timer.html[/url]

Member Avatar for Taywin
0
180
Member Avatar for london-G

[QUOTE=Prateek nandan;1667457]string can never be assigned directly... you can use for loop.. for(int i=0;i<name1.length();i++) name[i]=name1.charAt(i);[/QUOTE] Unless I have completely misunderstood this post... it's complete nonsense.

Member Avatar for Taywin
0
154
Member Avatar for Dexxta27

You add a drawclass and call its method, but that draws nothing. The drawing code is in class Moon.

Member Avatar for JamesCherrill
0
136
Member Avatar for pradeep_java

Each read method has its own way of signalling EOF when you attempt to read past the end of file, eg returning -1 for the number of bytes read. Because some read methods return (eg) Strings don't return a number, they have to signal EOF some other way, such as …

Member Avatar for pradeep_java
0
589
Member Avatar for alteran

You don't add all those individual items to the tree, you add a single person object that contains all those values. ie: You've got a name a dob, so you can create a new Person object with those values, and add the new Person object to the tree.

Member Avatar for JamesCherrill
0
192
Member Avatar for Armanious

What's that arrayCopy intended to do? You may get some small gain from less index calculation if you use a 1D array, but if that means you are having to calculate indexes yourself then that would be worse. In the end only a benchmark will tell you for sure.

Member Avatar for Armanious
0
173
Member Avatar for pits

DaniWeb Member Rules: "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]

Member Avatar for hfx642
0
99
Member Avatar for getmet

That's a perfectly reasonable way to do it, but this being Java please use a boolean array, not a numeric array with 0/1 values.

Member Avatar for JamesCherrill
0
92
Member Avatar for schoolboy2010

"crashes" tells us nothing. Do you get an error or Exception message? If so please post the whole thing, including the line number(s). EDIT: Sorry sorry sorry - just went back to main forum listing and saw your post's title. Sorry. I'm looking at the problem now... Line 111, why …

Member Avatar for schoolboy2010
0
207
Member Avatar for supersport

No, the first statement assigns a value to answer, the following 3 [B]replace [/B]it. You need something like[CODE]answer = answer + "(" + values[i] + ""; // + is String concatenation[/CODE] which can be written more concisely as[CODE]answer += "(" + values[i] + "";[/CODE] Your method signature is[CODE]public String markRuns()[/CODE] …

Member Avatar for inthearmynow99
0
1K
Member Avatar for woojungkyu
Member Avatar for mohamed moamen

If you have Java 6 (which you should by now) there is a new facility for displaying a startup screen even before your code starts to execute, and updating it with progress: [url]http://192.9.162.55/developer/technicalArticles/J2SE/Desktop/javase6/splashscreen/[/url]

Member Avatar for mohamed moamen
0
444
Member Avatar for dhija22

I've found Visual Paradigm to be pretty useful. It has a "Community Edition", free for non-commercial use. [url]http://www.visual-paradigm.com[/url]

Member Avatar for JamesCherrill
0
89
Member Avatar for vmc
Member Avatar for akemi3

[ICODE]letter == "V"[/ICODE] The == tests for letter and "V" both being exactly the same Object, which they are not, so it's always false. To test whether two string Objects contain the same sequence of characters you need the equals method, as in [ICODE]letter.equals("V")[/ICODE]

Member Avatar for akemi3
0
99
Member Avatar for vmc

The requirement states "the number of the month which was last constructed.", so I would suggest updating it in the constructor(s) not in the set... method.

Member Avatar for JamesCherrill
0
195
Member Avatar for Pancho jaylana

I see this is your first post, so please check out the DaniWeb member rules before you go any further and get a moderator on your neck! DaniWeb Member Rules include: "Do not hijack old threads by posting a new question as a reply to an old one" "Do provide …

Member Avatar for JamesCherrill
0
134
Member Avatar for TigerTeck

Method definition: [CODE] public void giveDollars (int dollars)[/CODE] Method call: [CODE] register.giveDollars());[/CODE] Number and types of parameters should match.

Member Avatar for JamesCherrill
0
135
Member Avatar for CKShia

You are confusing bytes that represent characters, eg '1'. '2' and bytes that contain a binary number eg 1, 2 Your option = scan.nextByte() will give you the ASCII code for '1' (etc), which is a numeric value of about 49 if I remember correctly.

Member Avatar for JamesCherrill
0
270
Member Avatar for Jfunch

You define a BlockingQueue without specifying what kind of Objects can go in the Queue, so it defaults to any Object. You add an int, and the compiler kindly converts that to an Integer for you. But when you try to take things from the queue all that Java knows …

Member Avatar for JamesCherrill
0
221
Member Avatar for vbmore
Member Avatar for Forte1292

"\n" isn't a command, it's just a new line character and you can use it in Strings just like you use "A" or "B". So, for example, the String "ABC\nDEF" is a valid String that when printed would look like this: ABC DEF Of course you could print it to …

Member Avatar for Forte1292
0
128
Member Avatar for techyworld

[QUOTE=techyworld;1664332]whats wrong in the program?[/QUOTE] Your recursive method works for me (assuming y>=1).

Member Avatar for techyworld
0
88
Member Avatar for drogba123

Do you mean to declare an array[26][5] so you can access individual elements with syntax like array['a'][2]?

Member Avatar for drogba123
0
121
Member Avatar for dgar

DaniWeb Member Rules: "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]

Member Avatar for peter_budo
0
120
Member Avatar for gotm

...or... use nested arraylists ArrayList<ArrayList<String>> rows and access the inner ArrayLists, and their Strings in the usual way.

Member Avatar for JamesCherrill
0
167
Member Avatar for cozmo87

I have no idea if this is relevant, but your [ICODE]form.setVisible(true);[/ICODE] seems at best redundant because the JFrame subclass to which it refers hasn't been populated or configured in any way.

Member Avatar for cozmo87
0
622
Member Avatar for Delocaz

This isn't an attempt to violate the DaniWeb rule that says "Do not ask for help to pursue any illegal activity including, but not limited to, hacking..." is it?

Member Avatar for Delocaz
0
1K
Member Avatar for marvolo1300

Don't know what VB has to do with Java syntax. In Java the {} thing is to define a literal array, eg [CODE]int[] a = {1,2,3};[/CODE] To assign one element of an array to another its just [CODE]a[i] = b[j];[/CODE]

Member Avatar for marvolo1300
0
136
Member Avatar for warlord902

You could subclass TreeCellRenderer and use setCellRenderer(javax.swing.tree.TreeCellRenderer) to draw each row with any arbitrary height, and setRowHeight(0) so the the current cell renderer is queried for each row's height.

Member Avatar for mKorbel
1
981
Member Avatar for herstein
Member Avatar for pradeep_java

[QUOTE=Taywin;1662153]Hmm... How about using "char" array of size 10^6? A char is size of byte which should be more than enough to hold that many digits?[/QUOTE] A Java char is 2 bytes.

Member Avatar for JamesCherrill
0
1K
Member Avatar for Justinedeleon

You set i on line 15, but then overwrite that on line 19 without having ever used the first value! Replace line 31 with [ICODE] e.printStackTrace();[/ICODE] so that you know exactly what the error was and exactly where it happened

Member Avatar for Justinedeleon
0
342
Member Avatar for sc0field1

Hi javaflasher. No disrespect, but have you checked a calendar recently? That problem was posted March 3rd. The OP will have either solved it or given up many months ago.

Member Avatar for JamesCherrill
0
122
Member Avatar for Laxman2809

[CODE]public void display(){ for(int i = 0; i<count; i++){ System.out.println(numofcd[numCD].toString(numCD));[/CODE] Shouldn't you use i to index into the array?

Member Avatar for Laxman2809
0
148
Member Avatar for liphoso

That's Java for you. Switches are for integer values and enums only, plus Strings if you are on Java 7.

Member Avatar for JamesCherrill
0
167
Member Avatar for atramposch

When you instantiate an array of Object references in Java, the array [B][I]is[/I][/B] initially full of nulls. (If you don't believe me try printing element[0] of a newly initialised object array)

Member Avatar for atramposch
0
138
Member Avatar for Ryden

If you just need some test data you can create and populate an int array like this: [CODE]int[] arr = {1,2,3,999}; // creates 4 element array with those values[/CODE]

Member Avatar for JamesCherrill
1
120
Member Avatar for niamul

[QUOTE=jeanrlavoie;1662578]I agree that java 1.7 will be released. It's on beta now.[/QUOTE] Wrong. Java 7 was fully released and made generally available July 28th 2011 Java 7 is the current release version. [url]http://www.oracle.com/technetwork/java/javase/downloads/index.html[/url] [url]http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-429209.html[/url]

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

SquareBaseContainer is abstract so you can't instantiate it. Eclipse is just following the Java language definition correctly.

Member Avatar for TheComputerGuy
0
135

The End.