Rose Evans

Ranch Hand
+ Follow
since Oct 14, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rose Evans

Thank you!!! That helped me so much!!! I have it all working now!
Hi guys, I have a question for you. I am making this web site, which has a form on it that users fill out and then email to me. The problem is...the form emails to me, but it is blank. It doesnt pick up any text that the users entered into the text boxes, nor does it pick up where they chose a selection from a radio button...

Here's my code, what am I doing wrong? I have the code in my body part of the htm page....



Thanks for your help!!!
OK thanks, I'll surely try that. Thanks a million!
if (document.drinkChoice.sodaRB[i].checked) {
alert(soda[i])
}

Not sure what to do with this i? I know it's a variable that needs to be declared.....
HI guys, I have a loop question for you...I don't know what I'm doing wrong...can you help??

Ha, I have no idea why it has to be there, my code works beautifully without the loop. My instructions are to create a for loop using an alert box to display the selection......I'm not sure why it's needed.
12 years ago
Hi Guys...I have a question, it's dealing with loops, but it is in javascript, not sure where I should post my question, but I figured a loop is a loop, right?
So, please can you tell me what I am doing wrong here?
Here's my code.


PS...I know my code looks silly .....had to take out some things for it to be able to post on here....
12 years ago
Thank you everyone...for such great help and advice....It is greatly appreciated!!!
13 years ago
Thank you so much for your help!!!
13 years ago
Why do I get these errors? Im so lost...

F:\Java II\MenuReporter\RoseSarah\MenuSwing2.java:14: 'class' or 'interface' expected
private JTextField message;
^
F:\Java II\MenuReporter\RoseSarah\MenuSwing2.java:137: cannot resolve symbol
symbol : variable message
location: class MenuSwing2
message = new JTextField(30);
^
F:\Java II\MenuReporter\RoseSarah\MenuSwing2.java:138: cannot resolve symbol
symbol : variable message
location: class MenuSwing2
content.add(message, BorderLayout.CENTER);
^
F:\Java II\MenuReporter\RoseSarah\MenuSwing2.java:138: cannot resolve symbol
symbol : variable content
location: class MenuSwing2
content.add(message, BorderLayout.CENTER);
^
F:\Java II\MenuReporter\RoseSarah\MenuSwing2.java:145: cannot resolve symbol
symbol : variable message
location: class MenuSwing2
message.setText("Yummy");
^
5 errors

Tool completed with exit code 1




[CODE]

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

private JTextField message;



public class MenuSwing2 extends JFrame implements ActionListener

{
//declare variables for components we will need
private JPanel foodPanel;
private JButton food1;
private JButton food2;
private JButton food3;
private JButton food4;
private JButton food5;
private JButton food6;
private JButton food7;
private JButton food8;

private JPanel rankPanel;
private JButton rankBtn5;
private JButton rankBtn4;
private JButton rankBtn3;
private JButton rankBtn2;
private JButton rankBtn1;

private JPanel outputPanel;
private JLabel banner;
private JLabel enterEntree;
private JTextField entreeNum;

//variables to hold food names (until file input in phased in)
private String s1="Classic Nachos";
private String s2="Fajitas";
private String s3="Cajun Chicken";
private String s4="Cheeseburger Deluxe";
private String s5="Tuna Steak";
private String s6="Ribeye Steak";
private String s7="Baby Back Ribs";
private String s8="Fried Chicken";

public MenuSwing2() // constructor
{

setSize (WIDTH, HEIGHT);
addWindowListener(new WindowDestroyer());
Container contentPane = getContentPane();
JPanel buttonPanel = new JPanel();
JPanel buttonPanel1 = new JPanel();

buttonPanel.setLayout(new GridLayout(2,8));
buttonPanel1.setLayout(new GridLayout(1,5));

JButton food1 = new JButton ("Classic Nachos");
food1.setBackground (Color.RED);
food1.addActionListener(this);
buttonPanel.add(food1);


JButton food2 = new JButton ("Fajitas");
food2.setBackground (Color.RED);
food2.addActionListener(this);
buttonPanel.add(food2);

JButton food3 = new JButton ("Cajun Chicken");
food3.setBackground (Color.RED);
food3.addActionListener(this);
buttonPanel.add(food3);

JButton food4 = new JButton ("Cheeseburger Deluxe");
food4.setBackground (Color.RED);
food4.addActionListener(this);
buttonPanel.add(food4);

JButton food5 = new JButton ("Tuna Steak");
food5.setBackground (Color.RED);
food5.addActionListener(this);
buttonPanel.add(food5);

JButton food6 = new JButton ("Ribeye Steak");
food6.setBackground (Color.RED);
food6.addActionListener(this);
buttonPanel.add(food6);

JButton food7 = new JButton ("Babyback Ribs");
food7.setBackground (Color.RED);
food7.addActionListener(this);
buttonPanel.add(food7);

JButton food8 = new JButton ("Fried Chicken");
food8.setBackground (Color.RED);
food8.addActionListener(this);
buttonPanel.add(food8);

JButton rankBtn1 = new JButton ("Excellent");
rankBtn1.setBackground (Color.RED);
rankBtn1.addActionListener(this);
buttonPanel1.add(rankBtn1);

JButton rankBtn2 = new JButton ("Very Good");
rankBtn2.setBackground (Color.RED);
rankBtn2.addActionListener(this);
buttonPanel1.add(rankBtn2);

JButton rankBtn3 = new JButton ("Average");
rankBtn3.setBackground (Color.RED);
rankBtn3.addActionListener(this);
buttonPanel1.add(rankBtn3);

JButton rankBtn4 = new JButton ("Fair");
rankBtn4.setBackground (Color.RED);
rankBtn4.addActionListener(this);
buttonPanel1.add(rankBtn4);

JButton rankBtn5 = new JButton ("Poor");
rankBtn5.setBackground (Color.RED);
rankBtn5.addActionListener(this);
buttonPanel1.add(rankBtn5);


contentPane.add(buttonPanel, BorderLayout.NORTH );
contentPane.add(buttonPanel1, BorderLayout.SOUTH);


message = new JTextField(30);
content.add(message, BorderLayout.CENTER);

// refer to the "Steps for Advanced Swing programs
}
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("Classic Nachos"))
message.setText("Yummy");


// stub
// do not complete this method yet
}
public static void main(String[] args)
{
// inFile is named MenuList.txt
// open File
// read in data for each menu item

MenuSwing2 chilis = new MenuSwing2(); //instantiate a GUI Object
chilis.setBounds(200,200,650,300);
chilis.setBackground(Color.CYAN);
chilis.setTitle("Menu Grader!");
chilis.setVisible(true);
}
}


[/CODE
13 years ago
Layne,,,thank you, thank you, thank you!! That was a duh on my part!! Ha ha...
Now would you know how to add a text field...in dummy terms for me???
13 years ago
Layne,,,thank you, thank you, thank you!! That was a duh on my part!! Ha ha...
Now would you know how to add a text field...in dummy terms for me???
13 years ago
You guys..I'm stuck again....My Lays button and my popcorn button do not work when I click on them....it looks like I made them the same way..so what's wrong???

13 years ago
You guys..I'm stuck again....My Lays button and my popcorn button do not work when I click on them....it looks like I made them the same way..so what's wrong???

13 years ago
OH my goodness...I DID IT!!! I added my own icon....!!! Yahhhhhhhhhhhhhhhhhhhhhhhhhhhhh!!!
Now I have to figure out how to do this text box thingy....oh my!
Any suggestions???

13 years ago