Why won’t this java work?

February 11th, 2010
jkherberger asked:


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

public class RectangleProgram extends JFrame
public final class Math

{
private JLabel lengthL, widthL,
areaL, perimeterL, diagonalL;
private JTextField lengthTF, widthTF,areaTF, perimeterTF, diagonalTF;
private JButton calculateB, exitB;
private CalculateButtonHandler cbHandler;
private ExitButtonHandler ebHandler;
private static final int WIDTH = 400;
private static final int HEIGHT = 600;

public RectangleProgram()
{
// Create four labels
lengthL = new JLabel(”Enter the length: “,
SwingConstants.RIGHT);
widthL = new JLabel(”Enter the width: “,
SwingConstants.RIGHT);
areaL = new JLabel(”Area: “,SwingConstants.RIGHT);
perimeterL = new JLabel(”Perimeter: “,
SwingConstants.RIGHT);
diagonalL = new JLabel(”Diagonal: “,
SwingConstants.RIGHT);

//Create four textfields
lengthTF = new JTextField(10);
widthTF = new JTextField(10);
areaTF = new JTextField(10);
perimeterTF = new JTextField(10);
diagonalTF = new JTextField(10);

//create Calculate Button
calculateB = new JButton(”Calculate”);
cbHandler = new CalculateButtonHandler();
calculateB.addActionListener(cbHandler);

//Create Exit Button
exitB = new JButton(”Exit”);
ebHandler = new ExitButtonHandler();
exitB.addActionListener(ebHandler);

//Set the title of the window
setTitle(”Area and Perimeter of a Rectangle”);

//Get the container
Container pane = getContentPane();

//Set the layout
pane.setLayout(new GridLayout(6,2));

//Place all items created
pane.add(lengthL);
pane.add(lengthTF);
pane.add(widthL);
pane.add(widthTF);
pane.add(areaL);
pane.add(areaTF);
pane.add(perimeterL);
pane.add(perimeterTF);
pane.add(diagonalL);
pane.add(diagonalTF);
pane.add(calculateB);
pane.add(exitB);

//set the size of the window and display it
setSize(WIDTH,HEIGHT);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}

private class CalculateButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
double width, length, area, perimeter, diagonal;

length = Double.parseDouble(lengthTF.getText());
width = Double.parseDouble(widthTF.getText());
area = length * width;
perimeter = 2 * (length + width);
diagonal = ([width * width + length * length]* sqrt);

areaTF.setText(”" + area);
perimeterTF.setText(”" + perimeter);
diagonalTF.setText (”" + diagonal);
}
}

private class ExitButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
}

public static void main(String[] args)
{
RectangleProgram rectObject = new RectangleProgram();
}
}

Earlene

My computer’s K: drive has been disabled. Why can’t I re-enable it? HELP?

February 9th, 2010
funk asked:


I found my dumbass of an 8-year old brother playing with my computer. When I sent him away, found about 10 randomly assorted windows opened on the screen. I noticed that I had left my 1G Lexar Firefly plugged in. It is usually assigned to the drive letter K: When I closed all the windows, I clicked ” Safely Remove Hardware” and the drive letter K was gone! I checked My Computer, and drive K ’s icon wasn’t even there. At this point I looked up how to re-enable a lost drive online. I found somethign and i tried it. First, I clicked Start, and then Run. In the Open box, I typed regedit, and then clicked OK.
I went to the registry location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor.
In the right pane, I double-clicked Start.
In the Value data box, I typed 3, made sure Hexadecimal was selected, and then clicked OK.
Then I quit Registry Editor. But after all this the drive was still gone. I downloaded and ran Tweak UI, went to My Computer, then Drives. It showed drive letters for all the letters in the alphabet. But only the letters C through J were clear. All the others, including my K: drive had a red question mark on them. I have get the feeling that this means the drives are disabled or disconnected or just not working for one reason or another. I don’t know what to do at this point. CAN ANYONE HELP ME?
In addition, i used to be able to plug my jump drive into my Xbox 360, but now my Xbox doesnt even recognize it.

Arlene

Questions for Excel. Please Help?

February 9th, 2010
Sandra asked:


6. Use the ____ button on the View tab to freeze worksheet titles so they display on the screen no matter how far you scroll.

A: Freeze Panes
B: Freeze Window
C: Freeze Titles
D: Freeze Window Panes

7. A ____ function is one in which the action taken for the true or false case includes yet another IF function.

A: Hidden IF
B: Complex IF
C: Nested IF
D: Double IF

8. Using the ____ button on the Ribbon, you can format a cell quickly by copying a cell’s format to another cell or range of cells.

A: Formatter
B: Format Painter
C: Copy
D: Layout

9. Using Excel to scrutinize the impact of changing values in cells that are referenced by a formula in another cell is called ____.

A: goal seeking
B: what-if analysis
C: sensitivity examination
D: what-if seeking

When first entering text in Excel, its angle is ____ degrees.

A: 0
B: 1
C: 45
D: 90

Larita

Is it easy for S.W.A.T. guys to crash through a window just with thier boots and a rope?

February 8th, 2010
Swampy asked:


I noticed in the movies they do it so easily! But I used to sell windows at home depot, and some of our windows are pretty sturdy! I don’t think even a 200lb man swinging in from eight or ten feet can break through the frame. I live in a hi-rise apartment building and the windows are aluminum with double glass. It would be possible for a man to swing through the glass, but he would have to be deadly accurate, or he would hit the middle frame that divides the top and bottom panes. If he hit that part he could probably knock the whole damn thing in, still, to actually come crashing in perfectly 100% of the time, is unlikely. Then to assume a shooting position immediately?! is even more difficult. I guess my question is: Are these guys THAT good? or do they have a special trick they use to penetrate windows in one smooth motion? Do they use a shotgun with “door duster” ammo? And do they get briefed with what the windows are made of if possible?

Arletha

I love Beyonce Knowles-Carter?

February 6th, 2010
HeatherBitch! asked:


1.Click this button on the Help and Support Center toolbar to find the information on a topic by typing a keyword, browsing a list of related topics, and then double-clicking the desired topic in the left plane. SEARCH
2.Click the button on the Help and Support Center toolbar to return to the opening Help and Support Center Window. BACK
3.Click this menu sequence to create a new folder in the My computer window.CREATE NEW FOLDER
4.Change the display of files and folders in the My Computer window to Thumbnails, Tiles, Icons, List or Details using this button on the Standard Buttons toolbar. VIEW
5.To select adjacent files, click the first file, hold down this key, and then click the last file.SHIFT
6.To select nonadjacent files, click the first file, hold down this key, and then click any other desired files.CONTROL
7.At the My Computer window, select a file, click the Copy this file hyperlink in the task pane, and this dialog box displays.COPY ITEMS
8.At the Move Items dialog box, choose the destination location in which to place the selected files or folders and then click this button to complete the action.MOVE
9.Files deleted from the hard drive are sent here. RECYLCE BIN
10.Delete a shortcut icon by dragging the icon on top of this icon.RECYLCE BIN
11.Open this window to display a list of categories in which you can customize the appearance and functionality of your computer.CONTROL PANEL
12.This wizard is automatically active in the Search window to walk you through the steps to complete a search.SEARCH CHAMPION WIZARD
13.This Windows accessory program contains features for preparing, editing, and formatting documents.WORD PAD
14.This Windows accessory program contains features for drawing black-and-white or color images that can be saved as bitmap files.PAINT
15.Customize the Windows XP desktop such as changing the theme, background, screen save, color scheme, and so on, with options at this dialog box.PROPERTIES DIALOG BOX

Edmundo

Little Johnny and the Teacher?

February 5th, 2010
Willy asked:


Willys cynical thought for the fugging day;

Windows: Is just another pane in the freaking glass!

Little Johnny kept disrupting his third grade class by regularly letting loud farts. His teacher kept him after school. When she insisted on  knowing why he exhibited such offensive behavior, Little Johnny said, “I do it because I can do it better than anybody, and I’m very proud of that fact.” The teacher says, “If I show you I can do it better than you, will you stop?” Little Johnny agreed and the teacher placed two pieces of paper on the floor with identical piles of chalk dust on each one. Johnny dropped his pants, squatted down, farted and blew all but a tiny little speck of dust off the paper. The teacher dropped her panties, lifted her skirt, squatted down and farted but when she was done, and there was not a trace of chalk dust left on the paper. Johnny was astonished and asked if he could see her do it again. She was willing and as she repeated the process, Johnny peeked up underneath her skirt. “No wonder you won!” he exclaimed indignantly, “you’ve got a Double-Barrel!”

http://www.total-knowledge.com/~willyblues/
I’m just here for a lil while but joe0_10 Johnny is the irrepresable little SOB who is a part of ALL boys! They either do stuff like this, or look on laughing at Johnny as he does! Of course this was all before being a freaking ‘Geek’ was fashionable!

Leopoldo

So what do I do about my ATI driver?

February 4th, 2010
Erick E asked:


Help would be greatly needed for this! I am not a computer whiz, so I have never encountered a graphics driver malfunction. I have an ATI HD Radeon 4600

Address a problem with ATI Graphics Driver
ATI Graphics Driver has stopped working properly.

A driver update, if available, might prevent this problem from recurring.

There are several ways of locating and installing driver updates, but it is best to let Windows do this for you. Try the first step below, which describes the process. If it doesn’t produce a driver update that solves the problem, then try the remaining steps in the order given.

Check for optional third-party updates

Even if all critical updates have been installed on your computer, optional updates might be available for ATI Graphics Driver that have yet to be installed. Here’s how to use Windows Update to check for and install optional driver updates:

Windows Update

In the left pane, click Check for updates to see if there are any optional updates available for your computer.

If no new optional updates are available, go to step 2.

If optional updates are available, click View available updates (if you do not see this option, you might have to click Check online for updates from Microsoft Update).

Windows Update or Microsoft Update will list any updated drivers that are available for devices installed in your computer.

Select any optional updates that are listed (especially if they appear to be graphics related), and then click Install. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

Try updating ATI Graphics Driver manually

If no optional ATI Graphics Driver updates were available in Windows Update, you can try updating ATI Graphics Driver manually.

Note
It’s best to let Windows install drivers for your hardware automatically, as described in step 1 above.

If you decide to manually update ATI Graphics Driver, here’s how to do it:

Click to open Device Manager If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

In Device Manager, double-click Display adapters, and then double-click the name of the device running ATI Graphics Driver.

Click the Driver tab, and then click Update Driver.

When asked how you want to search for driver software, click Search automatically for updated driver software.

Windows will locate and install a new driver if one is available.

Check the ATI Technologies, Inc. website for driver updates

If no optional ATI Graphics Driver updates were available in Windows Update, go online to the following website to check for driver updates:

Click to go online to the ATI Technologies, Inc. website to find out if a solution or update is available
How to manually update a driver using a downloaded file

Click to open Device Manager If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

In Device Manager, locate the device you want to update, and then double-click the device name.

Click the Driver tab, and then click Update Driver.

When asked how you want to search for driver software, click Browse my computer for driver software.

Click Browse, locate where you placed the new driver on your computer, click OK, and then click Next. Windows will locate and install the new driver.

Note
If you are running the latest version of ATI Graphics Driver and are still experiencing the problem, we recommend that you contact ATI Technologies, Inc. or the manufacturer for additional information and support.

Check your computer manufacturer’s website for driver updates

If ATI Graphics Driver was preinstalled on your computer, check your computer manufacturer’s website for driver updates.

How do I find my computer manufacturer?

Click the Start button , type msinfo32 in the Search box, and then press ENTER. Your computer manufacturer is listed as the System Manufacturer in the right pane of the System Information window.

Click to go online to see contact information for most computer manufacturers
How to manually update a driver using a downloaded file

Click to open Device Manager If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

In Device Manager, locate the device you want to update, and then double-click the device name.

Click the Driver tab, and then click Update Driver.

When asked how you want to search for driver software, click Browse my computer for driver software.

Click Browse, locate where you placed the new driver on your computer, click OK, and then click Next. Windows will locate and install the new driver.

What is a driver?

A driver is software that allows your computer to communicate with hardware or devices. Without drivers, the hardware you connect to your computer (for example, a video card or a webcam) will not
Actually, it is on Windows Vista but it is on my Gateway FX also. My monitor always shuts down whenever I try to load the game… any suggestions on what I should do?

Bertha

What is the temperature difference between the indoors and outdoors?

February 2nd, 2010
Chuck asked:


A double-paned window consists of two 60.0 cm × 100 cm glass panes, 2.00 mm thick, separated by a 1.50 cm layer of still air. 25.0 W of heat flow through the window.
What is the temperature difference between the indoors and outdoors? The thermal conductivity of glass is and that of air is

A) 27.6 K
B) 27.3 K
C) 26.9 K
D) 26.7 K
E) 26.3 K

can someone help me with this? it’s a practice problem i can’t get.

Can you help with Mortgage Calculator in Java?

February 1st, 2010
angel8136 asked:


Here’s my assignment? Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage. Allow the user to loop back and enter new data or quit. Please insert comments in the program to document the program.

I’m still getting errors! (see below) :-(

package MortCalc2.java ;

/**
*
* @author alesiab
*/
//Declaration of class
public class MortCalc2{

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}

}
//Declaration of class
/**
* @param args the command line arguments
*/

// Declaration of labels
import JPanel row1 = new JPanel(new GridLayout(1, 3));
import JLabel principal_label1 = new JLabel(”Net Amount $ :”, JLabel.LEFT);//Sets label text and alignment
JTextField principal_txt = new JTextField(10);
JPanel row2 = new JPanel(new GridLayout(1, 3));
JLabel term_label2 = new JLabel(”Term Yrs :”, JLabel.LEFT);
JTextField term_txt = new JTextField(10);
JPanel row3 = new JPanel(new GridLayout(1, 3));
JLabel rate_label3 = new JLabel(”Interest Rate %:”, JLabel.LEFT);
JTextField rate_txt = new JTextField(10);
JPanel row4 = new JPanel(new GridLayout(1, 3));
JLabel pay_label4 = new JLabel(”Monthly Payment $:”, JLabel.LEFT);
JTextField pay_txt = new JTextField(10);
JPanel button = new JPanel(new FlowLayout(FlowLayout.CENTER));

//Declaration of buttons and text shown on them
JButton rstButton = new JButton(”Reset”);
JButton extButton = new JButton(”Exit”);
JButton calcButton = new JButton(”Calculate”);

//Declaration for area to display user input
JTextArea displayArea = new JTextArea(10, 45);

// Declaration of number formats that will be output after calculation
DecimalFormat twodigits = new DecimalFormat(”#,###.00″);

//Declaration of variables
double rate = 0;//Sets rate as a double set to zero
double mpay = 0;//Sets monthly payment as a double set to zero
double principal = 0;//Sets principal as a double set to zero
int term = 0;//Sets interest as a integer set to zero
double interest = 0;//Sets interest as a double set to zero

//Declaration of constructor
public MortCalc2() {

super(”Mortgage Calculator: SR-mf-003 #4″);//Syntax used for calling constructor
setSize(400, 200);//sets size of the constructor
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//clears all info and closes window
Container pane = getContentPane();//returns the value for content
Border bdr = new EmptyBorder(2, 5, 2, 5);//provides borders for label

//Declaration of windows that will hold users input

pane.add(row1);
row1.add(principal_label1);
row1.add(principal_txt);
row1.setMaximumSize(new Dimension(300, 25));
row1.setBorder(bdr);

pane.add(row2);
row2.add(term_label2);
row2.add(term_txt);
row2.setMaximumSize(new Dimension(300, row2.getMinimumSize().height));
row2.setBorder(bdr);

pane.add(row3);
row3.add(rate_label3);
row3.add(rate_txt);
row3.setMaximumSize(new Dimension(300, row3.getMinimumSize().height));
row3.setBorder(bdr);

pane.add(row4);
row4.add(pay_label4);
row4.add(pay_txt);
row4.setMaximumSize(new Dimension(300, row4.getMinimumSize().height));
row4.setBorder(bdr);

button.add(calcButton);
button.add(rstButton);
button.add(extButton);
pane.add(button);

pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
setVisible(true);
setContentPane(pane);

button.setMaximumSize(new Dimension(10000, button.getMinimumSize().height));

//Adds specified action listener to get action events from buttons
rstButton.addActionListener(this);
extButton.addActionListener(this);
calcButton.addActionListener(this);
}
//Declaration of calculation actions to take place

public void actionPerformed(ActionEvent event) {

Object source = event.getSource();
//Begin “if” function
if (source == calcButton) // calculates on hit
{
validateUserInput(principal_txt, rate_txt, term_txt); // validates input

//formula for calculation output
mpay = principal * (rate / (12 * 100)) / (1 - Math.pow(1 + (rate / (12 * 100)), -1 * (term * 12)));
pay_txt.setText(”" + twodigits.format(mpay));
}

if (source == rstButton) // Clears on hit
{
term_txt.setText(” “);
rate_txt.setText(” “);
principal_txt.setText(” “);
pay_txt.setText(” “);
displayArea.setText(” “);
}

if (source == extButton) // Exits on hit
{

System.exit(0);
}

}//end action

//Declaration of the main method
public static void main(String[] arguments) {
MortCalc2 mtg = new MortCalc2();

}
//Declaration of user input for each variable

public void validateUserInput(JTextField principal_txt, JTextField rate_txt, JTextField term_txt) {
//Begin “try/catch” function
try {

principal = Double.parseDouble(principal_txt.getText());

} catch (NumberFormatException e)//Action listener
{
/

Kristle

What are a private landlords legal obligations towards a tenant?

February 1st, 2010
Hester W asked:


I currently rent a house from a private landlord, who has this lady to manage all the tenancy agreement, rent and keys etc. I have never seen the landlord. When I viewed the house before renting it, the girl living there at the time told me that the windows had a lot of condensation and that the cooker got very hot and was dangerous when kids were around. Not long after moving in, I asked the lady who manages it about the cooker, she said she would mention it to the landlord. Nothing ever happened and that was 9 months ago. I have asked numerous times since and nothing has happened. I have had to have the firemen out a few times, as there is water that leaks through the bathroom floor into the kitchen ceiling and drips down through thr kitchen light fitting. This is almost unavoidable due to the way the bath and shower are fitted, the only way I have found to avoid it is by putting towels along the side of the bath on the floor, they get sopping wet and I have to wash loads of towels all the time. The front door lock is broken, has been for about 3 weeks and I have told them, the landlord sent out his contractor and he had a look at that, the shower, the oven and the heating (which is also crap, old and broken). The oven is dangerous. It gets so hot to touch when the grill is o that you cant touch the buttons, and its starting to turn the laminated wood cupboards next to it brown and burn them…the laminate is peeling off. The lock still isnt fixed. The heating is old, if I leave it on for 5-6 hours the house isn’t warm upstairs at all…it takes the chill off slightly. Downstairs is red hot though. Also, the timer is broken so you have to go down the cellar to switch on the heating and the water comes out of the hot taps upstairs yellow sometimes…looks like pee. There is damp all through the house upstairs and when I have painted it has ruined my decorating (even after layers and layers of damp paint grrrrrrrrr) and the window seals do not even meet in the corners, there is about a 1-2 cm gap on almost all of them. There is condensation that builds up inbetween the two panes of double glazing and it also builds up on the inside, loads, and runs down all over the windowsill, and makes gross mould grow on the black sealing strip. Oh, and the lights blow out and trip out the system all the time. The last time, I took out the bulb and it had blown thr glass from the metal bayonet cap, it was all black and sooty! Also the light for my tortoise’s tank blew, and that one is plugged into a socket…not even on the main lighting circuit. I pay £600 a month for this house. Help lol. Its close to my sons school, I dont wanna move……nothing has been done despite me ringing the lady over and over. When my 6 month tenancy from april - nov ran out, she didnt even bring the tenancy for me to sign until last week! (23rd nov) I didnt dare ask about the stuff that needs fixing during the time I had no tenancy, as I thought they might just be able to throw me out….theres a lot of expensive work needs doing. When I rang her, she said she was ill, and then more recently, she said her dad had died and failed to keep to what she said about bringing the tenancy, my mum had to go fetch it from her. It also took her six months to bring round the landlords bank details, when I had asked for them from the start so I could set up a standing order.

Lean