Search Results

Showing results 1 to 40 of 54
Search took 0.01 seconds.
Search: Posts Made By: LevelSix ; Forum: Java and child forums
Forum: Java May 6th, 2009
Replies: 12
Views: 533
Posted By LevelSix
As far as the name part goes, you could have your box constructor also take a string variable, which is the team name. Then you could use the drawText method to draw the team name, linking the...
Forum: Java May 2nd, 2009
Replies: 2
Views: 301
Posted By LevelSix
You use a for loop in your increment method, so it prints out both lines. Removing the for loop and using a simple println will take out the duplicated line. Just be sure to increment the day.
...
Forum: Java Apr 27th, 2009
Replies: 6
Views: 275
Posted By LevelSix
There will be no code. This isn't a homework completion service.

Post the code you started or ask direct questions, no one here will do the work for you, but they will help you if you ask the...
Forum: Java Apr 15th, 2009
Replies: 6
Views: 666
Posted By LevelSix
So, a superscript?
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/font/TextAttribute.html May be of use.
Forum: Java Apr 8th, 2009
Replies: 19
Views: 776
Posted By LevelSix
Constructor for class video would appear as:
public Video(String name, int rating)
{
///store name and rating to instance fields
}
Then you would have methods such as:
public String...
Forum: Java Apr 8th, 2009
Replies: 19
Views: 776
Posted By LevelSix
What it appears you need to do is simply create one array, of type Video. Video will be a class you have to write, simple enough: Constructor with the two parameters and then return methods.

Once...
Forum: Java Apr 8th, 2009
Replies: 15
Views: 1,160
Posted By LevelSix
I was just trying to stem any confusion. I think we can all drop this topic, doesn't look like the starter is interested.
Forum: Java Apr 7th, 2009
Replies: 15
Views: 1,160
Posted By LevelSix
He mentions needing to use a for loop, not recursion. At least that is how I took it.

Taking user input is easily done using a Scanner.
Forum: Java Nov 17th, 2008
Replies: 3
Views: 641
Posted By LevelSix
Is there a way to modify this code so that a elements that would go beyond the frame appear on a new line instead? And also so that the next button iterates the count inside the square, but does not...
Forum: Java Nov 15th, 2008
Replies: 3
Views: 641
Posted By LevelSix
"Write a program to display a linked list graphically. Draw each element of the list as a box, and indicate the links with line segments. Draw an iterator as in Figure 15-3. Supply buttons to move...
Forum: Java Aug 14th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Would recursion make this problem any easier?
Forum: Java Aug 14th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
As I'm not sure how to implement the rotate method, I went back to try to get the calculations right. Unfortunately, I have not got it correct. My updated code:

import java.awt.Graphics;
import...
Forum: Java Aug 13th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Adding Grapics2D to the getKochPoints method would seem to cause numerous problems however. Then the calling of the method would have to be changed as well, and that method doesn't support graphics...
Forum: Java Aug 13th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
An idea that failed miserably. I can't seem to get the rotate(double) method to work at all. It tells me it can't find the method. I thought it was part of the Graphics2D package?

I'm probably...
Forum: Java Aug 13th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Hmm, I don't see how rotate would be applied, unless you rotate polygon.... Well, there's an idea.
Forum: Java Aug 13th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
I'm not sure if it will or not, and my professor is currently out of contact.

Which class are those methods from? Just from the names I can't really see how you'd use them for this.
Forum: Java Aug 13th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Is this calculation different for each side? Like I was doing?
Forum: Java Aug 13th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
So, after toying with the code you gave me, I've run into a problem. While I can supposedly get the next iteration to appear, all the others after that are incorrect.

import java.awt.Graphics;...
Forum: Java Aug 12th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Ahh, that makes more sense. Thanks.
Forum: Java Aug 12th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Your code here seems to use a class Point. Yes?
Forum: Java Jul 22nd, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Very. I can't for the life of me see why it does this.
Forum: Java Jul 22nd, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
I placed int variables in the draw method, and the paint method that are derived from the size of arrylist x. After draw is done being called, the size is 6. After the program moves on to paint, the...
Forum: Java Jul 21st, 2008
Replies: 22
Views: 2,313
Posted By LevelSix
This is what is printed to the text document. After I fixed the names of the objects so i was printing the right ones.
Forum: Java Jul 21st, 2008
Replies: 22
Views: 2,313
Posted By LevelSix
I modified each constructor class, and the main class. here they are:

import java.awt.geom.Line2D;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Color;
/**
* Course...
Forum: Java Jul 21st, 2008
Replies: 22
Views: 2,313
Posted By LevelSix
I re-worked my code, and found a different approach to fixing this problem. The objects now need a Color as one of their parameters, so a color button is first clicked, then the shape.

For my...
Forum: Java Jul 20th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
Yeah, I think you're right. That is why I mentioned the arrays. Is there a simpler way to convert arraylists to an array?
Forum: Java Jul 20th, 2008
Replies: 26
Views: 3,897
Posted By LevelSix
I need to write a program that draws the next iteration if a koch snowflake, when a button is clicked. It begins with a equilateral triangle. The program uses an ArrayList, Polygon, and GeneralPath,...
Forum: Java Jul 19th, 2008
Replies: 22
Views: 2,313
Posted By LevelSix
I didn't post any updated code because I haven't yet made any significant changes. I want to remove the Graphic interface from the actionlistener embedded classes, so I can remove the draw method. I...
Forum: Java Jul 19th, 2008
Replies: 22
Views: 2,313
Posted By LevelSix
I've started to tinker with the paint method. No results really. I've been able to get initial drawings, but not update them with the buttons yet.
Forum: Java Jul 16th, 2008
Replies: 22
Views: 2,313
Posted By LevelSix
Write a simple graphics editor that allows users to add a mixture of shapes (ellipses, rectangles, and lines in different colors) to a panel. Supply commands to load and save the picture.
...
Forum: Java Jul 16th, 2008
Replies: 4
Views: 1,880
Posted By LevelSix
The instanceof and casting seems to be what I was looking for, thanks.
Forum: Java Jul 13th, 2008
Replies: 4
Views: 1,880
Posted By LevelSix
Is there a way that after you store something, such a Rectangle, to an object variable, say, Object x, that you can then look at object x, and determine it is indeed a rectangle, allowing you to use...
Forum: Java Jul 7th, 2008
Replies: 12
Views: 2,331
Posted By LevelSix
I solved my problem, partly. I had forgotten to close the writer, closing it gained me a write out. I still only get prompted for one input file however.
Forum: Java Jul 4th, 2008
Replies: 12
Views: 2,331
Posted By LevelSix
I emailed my professor concerning this problem. The method he suggested was to open the file of writing to, then write each file to it line by line. I believe I have a problem somewhere with either...
Forum: Java Jul 2nd, 2008
Replies: 12
Views: 2,331
Posted By LevelSix
So I would use a FileReader to open the file, construct a scanner from the filereader, and append what I take from that scanner?

I'm also unsure of how to proceed with the array testing in the...
Forum: Java Jul 2nd, 2008
Replies: 12
Views: 2,331
Posted By LevelSix
I'm having a problem when running the code. It gives me the initial prompt, but then it doesn't re-prompt after I input a file. Also, I'm not exactly how I should implement a buffer. Could I get a...
Forum: Java Jul 1st, 2008
Replies: 12
Views: 2,331
Posted By LevelSix
If using a StringBuilder, what kind of capacity should I have? I'm thinking I make the builder, then use insert methods to enter the files. Then I would pass the builder to my PrintWriter?
Forum: Java Jul 1st, 2008
Replies: 12
Views: 2,331
Posted By LevelSix
Some of this code was edited by me, but not much. Only the first if statement. My main problem its the String target line, and the for loop. I don't know what to do with them. I'm also not sure what...
Forum: Java Jul 1st, 2008
Replies: 12
Views: 2,331
Posted By LevelSix
Basically, I need to write a program that takes a user input for multiple text files, and then prints them out into one file.

I usually try not to pose questions here back to back, but alas, I...
Forum: Java Jul 1st, 2008
Replies: 15
Views: 2,150
Posted By LevelSix
I think i finally completed the code. It seems to be working correctly now. I'll post it below and if anyone could take a look and see if there are any further errors I would appreciate it. Thanks...
Showing results 1 to 40 of 54

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC