201 Posted Topics

Member Avatar for computerbear

This is the code (in Java, if you don't know it don't worry, it is very similar so you won't have trouble understanding) for creating the wanted output with loops, hopefully this will help your project: [CODE=java]public static void main(String[] args) { String str = null; boolean needToBark = true; …

Member Avatar for apines
0
331
Member Avatar for Jean Chew

It states that the class TextBox does not have a method named Display(). In the [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox(VS.71).aspx"]MSDN [/URL]they have an example for using C# text boxes: [CODE=C#]private void CreateMyMultilineTextBox() { // Create an instance of a TextBox control. TextBox textBox1 = new TextBox(); // Set the Multiline property to true. textBox1.Multiline …

Member Avatar for apines
0
193
Member Avatar for newsb2Java

The file - is it binary or text? You want the first number to go into the int array, the next to one double array and the third to the second double array, and so on for each line?

Member Avatar for apines
0
2K
Member Avatar for PDB1982

You are not using the printf properly - you need to tell the method where do you want the String to be printed. Try this: [CODE=java]public Square(String name) { super(name); System.out.printf("Shape: %s", this.getName()); }[/CODE]

Member Avatar for apines
0
108
Member Avatar for StaticX

I guess that this is a question of design - Do you want the GUI class to be only for the GUI and the logic in another class or do you want all of the information to be together? Regarding to "what will work" - both approaches will work.

Member Avatar for StaticX
0
159
Member Avatar for srinivas88

Perhaps you will find more help in the [URL="http://www.daniweb.com/forums/forum24.html"]JSP[/URL] forum :)

Member Avatar for srinivas88
0
566
Member Avatar for Folasade
Re: Help

Sorry but I have to ask - have you tried [URL="http://tinyurl.com/2chsz2u"]this[/URL]?

Member Avatar for apines
0
110
Member Avatar for hatux

In order to parse the words, you can use the code string [iCODE]Pattern w = Pattern.compile("\\W+");[/iCODE]. The sentences are more problematic, since a sentence can be across lines. After parsing a sentence and all of its lines you have to check whether the last line ends a sentence, and if …

Member Avatar for JamesCherrill
0
102
Member Avatar for bufospro
Member Avatar for problemmaker

The compiler states that he cannot found the class named Main. Can you post your code?

Member Avatar for hanvyj
0
8K
Member Avatar for kchadek

The main method must be static. One way to go is to create a new Anagram object and use the dot notation to access its methods. [CODE=java]public static void main(String args[]) { Anagram anag = new Anagram(); anag.phrase1 = args[0]; //using dot notation to access the members phrase1 and phrase2 …

Member Avatar for apines
0
162
Member Avatar for apanimesh061
Member Avatar for jwill222

jwill, please do not use caps-lock. What code do you have so far? What have you tried?

Member Avatar for jwill222
0
163
Member Avatar for Goyle

I knew that assignment looked familiar, take a look [URL="http://www.daniweb.com/forums/thread324657.html"]here[/URL] :)

Member Avatar for Goyle
0
103
Member Avatar for titan5

Is this an assignment that you have or a possible solution to your problem? If it is the latter it's possible that there are better solutions - would you like to post the problem?

Member Avatar for afas87
0
4K
Member Avatar for nipponsahore

Try following [URL="http://download.oracle.com/javase/tutorial/deployment/jar/build.html"]these [/URL]instructions, and if you don't succeed we'll try figuring this out.

Member Avatar for nipponsahore
0
64
Member Avatar for dave1970

[CODE=java]Public class Student { //TODO: Implement. }[/CODE] And [CODE=java]Public class Course { //TODO: Implement. }[/CODE] What have you tried so far? Where do you get stuck?

Member Avatar for stultuske
0
235
Member Avatar for LianaN

The syntax for creating a new instance is [CODE=java]Class1 varName = new Class1();[/CODE] This will call the default constructor (you haven't defined any other). Now, to access the only thing you have in the class, which is the getAllSubjects() method, you use the [I]dot notation[/I] syntax [CODE=java]varName.getAllSubjects()[/CODE]

Member Avatar for LianaN
0
148
Member Avatar for iraqi4life

Read each line, which is a year, and use String.split(",") in order to split for the specific months.

Member Avatar for iraqi4life
0
183
Member Avatar for filmPC
Member Avatar for Sunshineserene

I have answered [I]your[/I] same question [URL="http://www.daniweb.com/forums/thread324267-3.html"]here[/URL]...

Member Avatar for apines
0
242
Member Avatar for mashhype

The number of values that will be in argv is exactly argc. When starting the program argc will be equal to the number of elements in argv, meaning that argv[0] through argv[argc-1] are existing cells.

Member Avatar for apines
0
79
Member Avatar for Akill10
Member Avatar for o0oKodako0o

Agree with jon.kiparsky, with two things to add: Instead of reversing the string you can zero pad it on the left to make Strings of the same length ([URL="http://download.oracle.com/javase/6/docs/api/java/lang/String.html#format(java.lang.String, java.lang.Object...)"]String.format[/URL] should do the trick). Second thing is be careful with the carry - you have to save it throughout the …

Member Avatar for apines
0
118
Member Avatar for rayden150

Please elaborate - you want to save to a file? to a variable? Please specify the exercise and where exactly you get stuck...

Member Avatar for kramerd
0
112
Member Avatar for reloaded2all
Member Avatar for apines
0
175
Member Avatar for vinitmittal2008

As far as I know, you can't pass statically created multidimensional array as an argument to a function. The way you have done it seems like a good way (if not the only one :)). Just be careful and don't do that on a dynamically allocated array, since you cannot …

Member Avatar for vinitmittal2008
0
10K
Member Avatar for Zibo

I am using Eclipse, and when using its export features I have always managed to export everything into one jar file. Also - a quick search came up with this: [url]http://one-jar.sourceforge.net/[/url], might help.

Member Avatar for Zibo
0
186
Member Avatar for powerteens001

This is the Java forum, you might want to visit the [URL="http://www.daniweb.com/forums/forum117.html"]JavaScript[/URL] forum :).

Member Avatar for Taywin
0
225
Member Avatar for printmatic

Copied it to Eclipse and ran it - didn't get an Error message, but the output seems off: [ICODE]Test Day Set day: Sunday Next day: Monday Previous day: Sunday After 4 days: Thursday [/ICODE] Your previousDay and nextDay are not modulo 7, meaning that they can get values that are …

Member Avatar for apines
0
750
Member Avatar for Eric Cute

[URL="www.eclipse.org"]Eclipse[/URL] has plugins for GUI building, that I know for sure. Never used one to recommend you about a specific one though.

Member Avatar for RushabhShah1110
0
176
Member Avatar for fahadyousaf
Member Avatar for Dhruv Gairola
-1
88
Member Avatar for orkuncanbay

It's a shame the you [URL="http://www.daniweb.com/forums/thread324157.html"]repeat[/URL] your messages.

Member Avatar for Eric Cute
-1
71
Member Avatar for shelexelex

Sure - Those are the command line arguments that are passed to the program. Just like any method in Java that can accept parameters, the main method accepts the String args[] as a parameter. When you run the program: [CODE]programName param1 param2 param3[/CODE] The program will start with the args …

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

In Java a booolean is a boolean, and an int is an int. 0 is not false, and 1 is not true. You can change your code to something like: [CODE=java]if (((num1 % 2 == 1) || (num2 % 2==1)) && (num1 % 2 != num2 % 2)) { System.out.println …

Member Avatar for optikali
0
184
Member Avatar for BLUEC0RE

I have to admit that I am a little bit confused - if you want to check the type of the object, you can use instanceof. If you want to compare two objects of the same type you can override the equals method. I am not sure what you are …

Member Avatar for BLUEC0RE
0
142
Member Avatar for sundip

Not familiar with the software myself, but a quick search revealed [URL="http://www.devx.com/ibm/Door/32285"]this site[/URL] which contains plenty tutorial, and also a [URL="http://tinyurl.com/37r9hht"]pdf[/URL] from the IBM site, even though it seems to be for C++.

Member Avatar for apines
0
56
Member Avatar for hwalsh

In your printA() method you have the line: [CODE=java]ArrayList<Integer> grade = new ArrayList<Integer>();[/CODE] Which causes the grade ArrayList to be created again, erasing the older one. Remove this line and it should work fine :)

Member Avatar for Overbooked
0
2K
Member Avatar for minimi

I am getting "ERROR: null" when trying to run your program with a file identical to the one you have posted here - are you sure that the Scanner usage is correct?

Member Avatar for javaAddict
0
188
Member Avatar for koushikG
Member Avatar for orkuncanbay

Are you trying to find such an application or to try and create one of your own in Java?

Member Avatar for orkuncanbay
0
185
Member Avatar for vij123

This is the Java forum - perhaps you would be able to get more help in the [URL="http://www.daniweb.com/forums/forum24.html"]JSP forum[/URL] :)

Member Avatar for masijade
0
107
Member Avatar for spades0001

Please use the [CODE] tags when posting code. First, it is a good practice to initialize the loop variable in the loop declaration an not outside of it. [CODE=java]public static void main (String[] args) { double sum = 0f; int ctr1 = 1; for (int ctr2 = 0 ; ctr<=77; …

Member Avatar for apines
0
146
Member Avatar for flyingcurry

kramerd is right - your semicolon at the end of the for loop at line 21 makes the loop to do nothing. Since you have declared i and j as members outside of the loop instead of creating them for each loop, the value of i at the end of …

Member Avatar for apines
0
177
Member Avatar for Dhruv Gairola

I don't, but [URL="http://www.jidesoft.com/blog/2008/02/29/rotate-an-icon-in-java/"]this guy[/URL] does :)

Member Avatar for Dhruv Gairola
0
80
Member Avatar for amit.hak50

ChaseRLewis - you are on the right track, and you can tight the bound even more by summing all the integers up to sqrt(n) instead of up to k/3, as can be seen [URL="http://en.wikipedia.org/wiki/Primality_test#Naive_methods"]here[/URL]

Member Avatar for apines
0
202
Member Avatar for sundeep_g

Do you mean that you have created one image containing the entire web page, and you would like to replace the boxes? This cannot be done as far as I know - you will have to slice your image into several images, and place them in the HTML. Then you …

Member Avatar for apines
0
92
Member Avatar for Overbooked

You can pass the displayText as a parameter [CODE=java]public void fillGrid(String displayText) { for(int i = 0; i < ROWS; i++) { for(int j = 0; j < COLUMNS; j++) { board[i][j] = new objPiece(displayText); } } }[/CODE]

Member Avatar for Overbooked
0
92
Member Avatar for schoolbus11

I'll go over with you about the max value, and then implement by yourself the min. Because we want to compare it to all the values of the array, we will initialize highest to be equal to the first cell of the array. [CODE=java]int highest = score[0];[/CODE] Now, let's iterate …

Member Avatar for Overbooked
0
111
Member Avatar for rational_

The way to use inheritance is to think what FixedFee and ChargeableFee have in common. Obviously most of the code for the two classes is identical, beside how and when they charge there fees. Assemble all the common information into one class, and use inheritance to only write the changes …

Member Avatar for apines
0
306

The End.