Would I be able to set it to "Desktop/GreatWall.JPG". Would that work if the image is there?
Type: Posts; User: Leonardo1143
Would I be able to set it to "Desktop/GreatWall.JPG". Would that work if the image is there?
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JFrame;...
How would I do the latter? just put in (double r)?
Here is what my compiler is telling me: GeometryCalculator.java:20: error: constructor Sphere in class Sphere cannot be applied to given types;
Sphere sp = new Sphere(r);
^...
Nvm fixed that one too
--- Update ---
Alright my code compiled without a problem. Thank you guys
--- Update ---
I'm having some trouble. Right now it's just that the compilier is telling me it cannot find the symbol
Grades.java:10: error: cannot find symbol
ArrayList<Integer> Grades = new...
Sorry I was doing this on a website. It messed up when I moved it here. But I fixed the problem.
public boolean sum28(int[] nums) {
int [] sum28 = {10,2,2,2,2,50};
int sum;
for (int i=0; i<sum28.length; i++) //This will cycle through the elements
{
if (sum28[i] == 2) //If...
Oh sorry for ambigious in my first post. But What I was wondering is how to loop it, effectively, and what are the coordinates. For example (x,x,x,x). What do each of those x's represent when i want...
import javax.swing.*;
import java.awt.Graphics;
import java.awt.Color;
public class MyDrawing_Start extends JFrame {
public MyDrawing_Start() {
add (new MyPanel());
}
public static...
Okay, now i am bit confused. So I may just go the longer route and just individually label the parts I need for my algorithm to work (armor,combat level,etc). Thanks for trying though.
Oh okay so using 10 for my example should fix it?
I chose 27 because it was used in the example
That was the whole error message and No I don't know what the radix was I was basing it off the API's example.
I thought the second arg,27, was for radix? The API used that as an example.
"Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at...
Armor = parseInt("Armor", 27)
like that?
So how would I go about assigning the string value of armor to an int? Like I said
parseInt("Kona", 27) returns 411787
returns a value but when I try
parseInt("Armor", 27)
Okay I read it and don't completely understand it. If I have a string value, like armor, Do i put it in like this?
Integer.parseInt(Armor);
...
Where would I find the API document?
Sorry it seems I was supposed to use "Integer.parseInt()". But how would I go about changing something like armor, a string, to 25, an int value, using this?
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method parseInt(JTextField) is undefined for the type new ActionListener(){}
at...
import javax.swing.*;
import java.awt.event.*;
import java.util.Random;
public class SimpleWindow extends JFrame {
JLabel...
Thank You, Norm. I got it to work thank you for being so patient with me.
Oh. I think I'm getting it. Remove setText(). from the method and move into the action listener only?
Okay which line of code is calling the setText()? I can't see it? Because I thought I needed to place getText in order for the setText to be called. I'm guessing this is wrong?