Jae Lee

Greenhorn
+ Follow
since Jun 10, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jae Lee

thank you for your input.
i wish my professor went over this before hand.
after reading up on the topics, i seem to have a better grasp of things.
thanks for you help. i really appreciate it.

J
12 years ago
Hi. I am trying to send a file "Props.txt" from a client to a server using a Socket.
I am currently receiving and error from the server side stating that there is a "Connection Reset".

I am wondering what I am doing wrong.

Client:


Server:


thank you in advance for the help.
12 years ago
Hello to all,

I was wondering if there was a way to invert an array.
(ie.


and the result will be
1
2
3
4
5


thank you
12 years ago
I feel really stupid and i found my own mistake.
13 years ago
Hello everyone,

I am currently taking an online intro to java class. The professor has not been able to get back to me and I need to understand this in order to complete the hw which is due at the end of the week.
I have copied my entire code from top to bottom

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


class third extends JFrame
{
JButton b1, b2, b3;
JPanel p1;

third()
{
setTitle("getting smarter with swing");
setSize(300,400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

b1 = new JButton("b1");
b2 = new JButton("b2");
b3 = new JButton("b3");

p1 = new JPanel();

b1.addActionListener(new b1Listener());
b2.addActionListener(new b1Listener());
b3.addActionListener(new b1Listener());


setLayout(new FlowLayout());
p1.add(b1);
p1.add(b2);
p1.add(b3);

add(p1);

setVisible(true);
}



class b1Listener implements ActionListener
{
public void actionPerformed(ActionEvent b)
{
if (b.getActionCommand().equals("b1")) //will return b1, b2, b3 as a string
p1.setBackgroud(Color.RED);
else if (b.getActionCommand().equals("b2"))
p1.setBackground(Color.BLUE);
else if (b.getActionCommand().equals("b3"))
p1.setBackground(Color.YELLOW);

}
}


public static void main (String [] args)
{
third a1 = new third(); //create object for second class
}
}


The bold is where I am receiving the error. Here is what it looks like verbatim.

second.java:44: cannot find symbol
symbol: method setBackground(java.awt.Color)
location: class javax.swing.JPanel
p1.setBackground(Color.RED);

Please HELP. THANK YOU
13 years ago