yes that what im asking. i need the number to stay the same so if i have an instance variable, called int randomNumber. and had this returned would it stay the same?
Type: Posts; User: chonch
yes that what im asking. i need the number to stay the same so if i have an instance variable, called int randomNumber. and had this returned would it stay the same?
no cuz im not sure on the return if i leave num as the return does it stay the same number until user guess the right price and my showstatus says "your right"
ok i have this now
public int generateQuestion()
{
Random rand = new Random();
int num = rand.nextInt(51) + 101;
questionLabel.setText( "Guess oil price (100 - 150)" );
return num;
}
stuck at generating the number from 100 -150.
need to write write a Java applet that will let the user guess the gas price and compare it with the price predicted by my program. Guess gas price (100 - 150): that never changes. so far i have this...
but r.nextInt(High-Low) + Low i know isnt applet
in goggle i found
int Low = 10;
int High = 100;
int R = r.nextInt(High-Low) + Low;
im not sure how to code the generated a random number from 100 to 150 inclusive for an applet
need to Write a Java Applet as a small airline reservation system. The system has only one airplane with 10 seats: 1 to 5 for first class and 6 to 10 for economy. The applet has two buttons and a...
not sure where i input the... If the user selected section has no available seat, your program should ask if the user is OK with the other section seats. If the user clicked OK, you print the...
lol i have no idea..i been and it for a while now tho lol i called super.paint(g) and still black applet i just get the textfield
k i have this with super(g). but the question doesn't show now.
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;
public class Assign6...
when i run it nothing shows
paint covers all my text..not sure how to fix
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;
public class Assign6 extends JApplet...
k made the applet but not the paint covers out my Text fields? do i override the paint? if so how?
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.*;
import...
how would i go about fixing it to make it applet?
when i run it its blank and im not sure why?
{import java.awt.*; // Container, FlowLayout
import java.awt.event.*; // ActionEvent, ActionListener
import java.util.Random;...
how do i get "its crazy" if gas goes past 4 in the avg?
import java.util.Scanner;
public class mk2
{
public static void main(String[] args)
{
i wrote this but my song isnt showing up.
import javax.swing.*;
public class Assign5 {
public static void main( String args[] )
{
String result = "";
JTextArea songArea...
i dont get what ur asking
i have this much but i dont get why my high profitable items is 0 and bonus is 0...should be 1 and 20
import java.util.Scanner;// program uses class Scanner
public class Assign4
{
...
ahh i see this i have radius set in string and my variable therefore it goes to both.. thanks
when i run applet my radius is 0 why? heres my code
import java.awt.Graphics;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class Assign3 extends JApplet
{
i have it like this but when i hit cancel on both name and last name i still get the null message " hello welcome, null null, to cis226. whats wrong?
//CIS 226 Assignment 2
//The GUI - Assign2...
thanks i saw the name = null in my book but i think i was missing the null in my script. but thanks again