TRENDING NEWS

POPULAR NEWS

Java Programming Help Create Applet

Help me for the JAVA program.?

You can do something like this

public void paintComponent(Graphics g)
{
Graphics2D g2d = (Graphics2D)g;
...
g2d.translate( x, y ); //set your origin or leave it at 0,0
g2d.scale( scale, scale ); //zoom in and out by changing the scale
...
//draw your image
...
}

Computer programming applet help?

I Need help with these questions, anything help! Thank you for your time!

The package required by both Java GUI applications and applets the _______package

To create a Java application with a GUI requires the programmer to use or extend the ____________ class.

A _____________ is a component that displays text in a GUI application or applet.

To ensure that a Java GUI application exits properly when its main window is closed, simply use this statement: ___________

To place a component on a Container, invoke its ___________ method.

Java programming questions--code for either one would be great?

You really should do your own homework. You won't learn anything if I just give you the answer.

That said, the class java.util.Random could be of some help with setting up your random window placement. You could use it to set up the number of windows and then for the placement of each window and then the random heights, widths and positions of the buildings in your "skyline".

The Random class generates "pseudo-random" numbers, so to create some TRUE randomness you may want to "seed" your Random object with the current system time.

Java applet help (buttons) ?

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;

public class program extends Applet implements ActionListener
{
JLabel info;
int number = 50;
public void init ()
{
JButton adding = new JButton ("Add");
adding.setActionCommand ("add");
adding.addActionListener (this);
JButton subtract = new JButton ("Subtract");
subtract.setActionCommand ("subtract");
subtract.addActionListener (this);
info = new JLabel (number + " ");
add(adding);
add(subtract);
add(info);
}


public void actionPerformed (ActionEvent e)
{

if (e.getActionCommand ().equals ("add"))
{
number++;
info.setText (number + " ");
}
else
{
number--;
info.setText (number + " ");
}
}
}

Here is the code....I hope it helps

Java Programming Assistance needed...?

I need help with Java programming...I am not good at all with these programs and so I don't even know where to begin. Can someone help me create an applet to draw a digit using the method fillRect of the class Graphics. For instance, if the input is 6, the applet will display the digit 6. Thank you.

Applet question for Java. Help please.?

Why your printed CandeLine doesn't show:

in your init() method you must add(salesLabel);


Why your getting 0.000 on standard delivery:

On your getComm method if code=3 on your switch statement instead of using calculation to store the answer your using answer to store it but your returning calculation this getComm method is what it should look like

public double getComm(double sales, int code)
{
double calculation = 0.0;
System.out.println(code+"maed it here");
switch(code)
{
case 1:
calculation = 16.95 + sales;
break;

case 2:
calculation = 13.95 + sales;
break;

case 3:
if(sales > 100.00) calculation = sales;
else
calculation = 7.95 + sales;
break;
}
return calculation;
}

and please always remember to give Best Answer!!

TRENDING NEWS