Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Alec B
Creating a Circle (Java)?
Create a GUI application that will draw a circle of a color selected by the user.
The application will feature:
Three regular push buttons that will draw the circle in the designated color.
A panel on which the circle will be drawn.
A menu with a File and an Edit option.
The File menu will have an Exit option.
Upon selection, the Exit option will terminate the application.
The Edit menu will have a Clear option.
Upon selection, the Clear option will clear the window (make the circle disappear) by calling the repaint method.
Paint method code that draws a black circle.
The paint method will be called automatically when the application starts up, and whenever the repaint method is called.
1 AnswerProgramming & Design8 years agoMaking a Quit Button (Java)?
Here is my program, I would simply like to make a quit button that prompts the user yes or no if they would like to quit.
import java.awt.event.*;
import javax.swing.*;
public class Retail extends JFrame
{
private JPanel panel;
private JLabel messageLabelA;
private JLabel messageLabelB;
private JTextField wholesaleTextField;
private JTextField markupPercentageTextField;
private JButton calcButton;
private final int WINDOW_WIDTH = 400;
private final int WINDOW_HEIGHT = 200;
/**
*
*/
public Retail()
{
setTitle("Retail Price Calculator");
setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
buildPanel();
add(panel);
setVisible(true);
}
private void buildPanel()
{
messageLabelA = new JLabel("Enter wholesale cost then");
wholesaleTextField = new JTextField(10);
messageLabelB = new JLabel("enter markup percentage:");
markupPercentageTextField = new JTextField(10);
calcButton = new JButton ("Calculate");
calcButton.addActionListener(new CalcButtonListener());
panel = new JPanel();
panel.add(messageLabelA);
panel.add(messageLabelB);
panel.add(wholesaleTextField);
panel.add(markupPercentageTextField);
panel.add(calcButton);
}
private class CalcButtonListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
String wholesaleInput;
String markupInput;
double wholePrice;
double markUp;
double retailPrice;
wholesaleInput = wholesaleTextField.getText();
wholePrice = Double.parseDouble(wholesaleInput);
markupInput = markupPercentageTextField.getText();
markUp = Double.parseDouble(markupInput);
retailPrice = ((wholePrice * markUp) * .01) + wholePrice;
JOptionPane.showMessageDialog(null, "Retail Price: $" +
retailPrice);
}
}
public static void main(String[] args)
{
new Retail();
}
}
3 AnswersProgramming & Design8 years agoPossible Colon Tearing?
Months ago I noticed a slight popping feeling in my lower left abdominal side while I was pushing to go to the bathroom. Since then I've noticed random blood in my stool that is bright red which I assume signifies the problem is close to my rectum. I also had a period where I was constipated for awhile but was normal for a while after. This last week I have had an upset stomach and was pushing hard to go to the bathroom. I had blood in my stool this morning, but my side hurts more now than it ever did before. Not excruciating but highly uncomfortable. I don't have health insurance right now so I'm not sure when I can see a doctor. I assume I tore part of my colon and it's leaking blood into my stool when I go to the bathroom. Is there something I can do to help heal by myself or should I seek medical attention?
4 AnswersMen's Health1 decade agoHow do I ask a girl to run a train with my friend if she is already into both of us?
Most likely, we'll all be drunk...
3 AnswersSingles & Dating1 decade agoWhat type of humor is this? irony, euphemism, etc....?
This next quote is said from Elizabeth to Charlotte’s sister Mariah about Charlotte being wed with Mr. Collins:
“I like her appearance. She looks sickly and cross.-Yes, she will do for him very well. She will make him a very proper wife.” (136)
This quote is funny because it’s saying that Mr. Collins is so strange that Charlotte being sickly and cross would suit him well.
I'm having trouble deciphering what type of humor this quote from Pride and Preudice is
1 AnswerQuotations1 decade agoCan I take vicodin that expired in 1998?
because i just did
10 AnswersPain & Pain Management1 decade ago