Hi,
I'm not looking for anyone to do this question for me, but I was wondering if I could get some clarification on what you think this question is asking:
"Write a program to determine if a...
Type: Posts; User: Tedstriker
Hi,
I'm not looking for anyone to do this question for me, but I was wondering if I could get some clarification on what you think this question is asking:
"Write a program to determine if a...
class BreakExample2
{
public static void main(String[] args)
{
System.out.println("(Please enter a number from 1 to 6)");
ConsoleReader console = new...
variable num is already defined in method main(java.lang.String[])
That is the exact error, with for(int num = 1; num < 6; num++) being highlighted.
Sorry, the error is related to this line:
for(int num = 1; num < 6; num++)
the error is "variable num is already defined in method main(java.lang.string{})
class BreakExample
{
public static void main(String[] args)
{
System.out.println("(Please enter a number from 1 to 6)");
ConsoleReader console = new...
print.out.format worked, thanks.
Hi,
I'm writing a basic program that requires the user to input a number. When the input is printed, I would like to add a dollar sign to it. mu code is as follows:
class Corruption
{
...
Sorry for my poor explanations guys. I've been working on this, and made a little progress. this is what I have so far:
import java.util.Scanner;
class Adding
{
public static void...
it would be all at once, as in :
123456789
the sum is 45.
Sorry guys, I should have been more specific. The user will input 9 consecutive numbers, and the output needs to be the sum of the numbers.
Hi everyone,
Sorry for posting here if this is not the correct place, but I have a question I'm kinda stumped on.
I need to create a program to add together a row of numbers, something like...
Worked like a charm, thanks alot.
hello,
I have a little assignment where I have to create a primitive currency converter from CAD to NR. Below is the code I have so far:
import java.util.Random;
public class BigDecisions...
Thought I would post in this thread instead of creating a new one, as my question is related. The next part of the book I'm working with is to add buttons to the window created. The following is my...
import javax.swing.*;
class Window extends JFrame
//beginning of class
{
JPanel pnl = new JPanel() ;
public static void main ( String[] args)
//beginning of main method
{...
Ok, corrected that...looks like its getting better. However, I now get the following error:
add ( pnl ) ;
^
cannot find symbol - variable pnl
Now I get this error:
public Window()
^
invalid method declaration; return type required
import javax.swing.*;
class Note extends JFrame
//beginning of class
{
public static void main ( String[] args)
//beginning of main method
{
JPanel pnl = new...
Thanks Norm, but reading that just doesn't make sense to me. When it says JPanel pnl = newJPanel(); goes before the main method, where would that be? where would the different methods begin and end....
So I've been messing around with this. While its still wrong, at least I got a different error (class, interface, or enum expected with the ^ under the word void) with this effort:
import...
Sorry Norm, but I'm having allot of trouble with this.....I gather my original code is arranged wrong due to the placement of my {s? How should they be arranged?
the book I'm using reads as follows:
1) Start a new program that imports all Swing components
import javax.swing.* ;
2)Create a subclass of the JFrame class named "Window" containing...
I tried changing the class name, but it didn't seem to make a difference.
I tried compiling it through the command prompt, and got the following results:
Window.java:7: error: ';' expected
...
import javax.swing.*;
class Window extends JFrame
{
public static void main ( String[] args)
{
JPanel pnl = new JPanel() ;
public Window()
{
super(...
import javax.swing.*;
class Window extends JFrame
{
public static void main ( String[] args)
{
JPanel pnl = new JPanel() ;
public Window()
{
super(...