Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Moving to C++.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Well its just a question
And I just attempted to explain. You didn't bother to answer my questions about the errors you received, so I can't really clarify why you received them.

Majestics commented: Want your autograph +8
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Were you defining those at the class level or in a method? Static declarations like that only apply at the class level.

I'm guessing you got error 2 with statement C? C is not valid syntax.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Check spelling and capitalization as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Say you finish asking a question...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And what do you think that error means?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Lyzanxia - Strength Core

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You'll find that "an error" is very little to work with. Post the entire error message.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The first is standard shortcut syntax for the creation and initialization of an array in the same statement it is declared.

The second is using a static code block to create and initialize.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually, you should override paintComponent(Graphics) instead of paint(Graphics) and called super(g). The paint() method has a few other responsibilities such as painting the border and children as well managing partial repaints.

Overriding paintComponent() is recommended for custom rendering.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

^ What Norm said.

Thread closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

From the rules:
Do provide evidence of having done some work yourself if posting questions from assignments.

Thread closed. Try again when you have specific questions about your code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you wish to hire someone to verify the translations, you should create a posting in the Looking To Hire forums.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why not use Google instead of expecting others to do it for you?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you wish to access the method without an instance of your WordRepeater class, you will need to declare the tester method 'static'.

public static boolean tester (...
Genericusername commented: Prompt, Helpful, and Concise +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, the forum rules clearly state:
- Do provide evidence of having done some work yourself if posting questions from assignments.

Thread closed. Try again when you can show the slightest indication of effort.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to loop through the list and get each "Ticket" object and check its id. You can only call getId() on an object of type Ticket, not the Ticket class itself.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You don't need to set the background in paint(). You can set it in the constructor once and it will persist.

You specifically do not want to override the paint() method like that because you are preventing the labels from being rendered at all. In Swing components, you should override paintComponent() if you need to provide custom rendering.

Just remove the paint method declaration altogether and move your background call up to where you are adding the other components and see if that gets you where you want to be.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, as Norm said, you do not need to create those arrays in the method call. I merely did that as a quick example in your other thread. That signature is actually

createCategoryDataset(java.lang.Comparable[] rowKeys, java.lang.Comparable[] columnKeys, double[][] data)

The arrays do not even necessarily have to be String[].

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> anyways... please, no more referrals unless you have something referrably useful

Actually, that is vegaseats signature.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Thanks. Dealt with.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

From the rules: Do provide evidence of having done some work yourself if posting questions from assignments.

Show some effort and ask specific questions about the part you are struggling with. Regardless of circumstance, this is not a homework completion service.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

James is correct. Please start a new thread if you have a question and state it more clearly. What you posted is rather vague.

Thread closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

What have you tried so far? What have you thought about trying?

From the forum rules:
- Do provide evidence of having done some work yourself if posting questions from assignments.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If the rental company must display the cars that are available, it must have some access to tell if the car is currently rented.
I'm not sure what you are expected to do there because I don't know all the parameters and expectations of your assignment.

Perhaps you can check one of the other properties that you do have public access to? The data for a few of them looks like it will be easy to tell if the car is rented.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you want to print out the index along with the description, you can use the following basic idea:
1) for() loop over the list, from 0 to size-1.
2) inside the loop, get() each car and check if not onloan
3) if not onLoan, print the index (which is your loop variable) + getDescription()

If you prefer to use the for-each loop you started with, consider the following:
1) if (cars.size()>0) isn't really needed because for-each loops automatically only loop through elements that are in the list. If it's empty, the loop just doesn't do anything.
2) This seems counterproductive to counting: int i = 0;

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, Java uses zero-based indexing almost exclusively. You can't change it to start at 1.

The fix I'm referring to is not difficult and is something you'll need to get used to in Java. In all places where you check if carNum is greater than size(), you simply need to amend the operator you're using. If the index equals size, that is also an invalid index.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That does not look like a valid connection string. You need to use something closer to this

String connectString = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + projectDirectory + filename;
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

"It is showing error" is not helpful to anyone. If you want help resolving an error, you need to post what it is.

You also need to read the forum rules about using clear, relevant titles for your threads. "problem!" is not a useful title.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Don't forget that index==size() is also too large. Double check your verification code with that in mind.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, you can use this method to create any series and category labels you want

final CategoryDataset dataset = DatasetUtilities.createCategoryDataset(
            new String[]{"a","b","c"}, new String[]{"bob","mary","sue"}, data
        );

That produces data series a,b,c and the domain categories bob,mary,sue along the x-axis.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's your dataset. You have created it with those values (category,value) .

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I believe James is correct that the problem lies in the missing revalidate() and repaint() on your panel. When add/remove components from a container, you should validate the container so layout is updated. Repaint will ensure that whole component gets repainted and not just regions that the RepaintManager thinks are dirty.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

In your rent and return methods, you're looping the whole list and acting on every car

for (Car car : cars) {...

You need to get() just the one car and operate only on that car object.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your domain axis (x-axis) should display the categories you've supplied. It's not a range of values, it's a discrete set.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's a paperback - not an ebook. There are a ton of copies for sale online.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why did I write this in bold?

codeorder commented: "just.because"?xD +0
BitBlt commented: It tricks us into thinking it's profound. +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, that's off-topic and more of a personal problem.

Perhaps a reply acknowledging the suggestions pyTony and woooee made above would be more appropriate.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Look over the APIs for those two classes. There are methods to print new lines.

BufferedWriter is another option.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hotswap just refers to automatically applying changes to your current debug session without need to stop, compile and restart the session. From some quick reading, Eclipse is supposed to do this for you automatically if you save changes that you make while debugging a file. You'll need to be sure that 'Build automatically' is enabled in your project.

Hotswap does have some limits like not being able to make schema changes such as adding/removing properties or methods, etc.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can use PrintWriter or FileWriter for that.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why have you copied in a partial method declaration into your code block?

As far as where to check the string, you need to check each line, right? That should suggest where to put the code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You only have to do two things:
1) Determine if the line read contains the string the user input.
2) If it does, return the portion of that string after the ":"

As Norm already said, you just need to read over the methods in the String class that do those things. The comparison methods you listed above compare an entire string. That is not what you are wanting to do.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'm not seeing any reason to even have the ArrayList at all. You can add and remove nodes directly on the tree model.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can mark a thread solved by clicking the "Mark This Thread As Solved" link at the bottom. Others can still post in the thread.

Only a moderator can actually close a thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I can read just fine kesh1000. The "engine" you use should have also noted that 'c' is not a legal statement. An int is not an object.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you have to choose three, it's an invalid question. Only two of those are legal operations.

(And one of those two is only valid for testing object reference equality)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Perhaps change the parameters to your addModule() method to DefaultMutableTreeNodes or at least pass tree model you wish to add the node to?

It's really a TreeModel B that you want to add nodes to from TreeModel A. Specifically there is some node in B that you want to attach a new child node to from model A.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can only add nodes to other nodes, which you do through the TreeModel. The JTree component does not have an add(Node) method.

http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Religion has little to do with it, it's one of our forum rules:
- Do provide evidence of having done some work yourself if posting questions from assignments.