473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Applet question

this is an applet for a white board with an append button on it, when you press it what ever you have typed in one box should show up in the second box, but it doesn't. Have the program doing everything but that.


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

public class WhiteBoard extends JApplet //start of applet
{
private static int WIDTH = 550;
private static int HEIGHT = 350;

private int row = 10;
private int col = 20;

private JLabel headingL;
private JTextField lineTF;
private JTextArea whiteBoardTA;
private JButton exitB, appendB;

public void init()
{
Container pane = getContentPane();

headingL = new JLabel("Welcome to White Board");
lineTF = new JTextField(20);

whiteBoardTA = new JTextArea(row,col);

appendB = new JButton("Append");

pane.setLayout(null);

headingL.setLocation(50, 20);
lineTF.setLocation(20, 100);
whiteBoardTA.setLocation(320, 50);
appendB.setLocation(230, 100);
exitB.setLocation(230, 250);

headingL.setSize(200, 30);
lineTF.setSize(200, 30);
whiteBoardTA.setSize(200, 200);
appendB.setSize(80, 30);
exitB.setSize(80, 30);

pane.add(headingL);
pane.add(lineTF);
pane.add(whiteBoardTA);
pane.add(appendB);
pane.add(exitB);

} //end of the constructor

public void actionPerformed(ActionEvent e) //thinking this is the problem area
{
if(e.getActionCommand().equals("Append"))
whiteBoardTA.append(lineTF.getText());

}
}
Jan 26 '07 #1
2 1151
Never mind I have got it figured out.
Jan 27 '07 #2
r035198x
13,262 8TB
Never mind I have got it figured out.
Good. Now next time juat remember those code tags when posting code.
Jan 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Kookymon1 | last post by:
This is an attempt to respond to an older question (several months). Date: 2002-03-07 13:10:23 PST Subject: On the Common DOM API and Applets. The original message was: >LiveConnect and the...
1
by: Wayne's World | last post by:
hi everyone, i have a big problem, writing a image from my applet to my apache webserver. i tried three way's of writing that file. every way was described in forums to solve this problem, but...
5
by: Rowland | last post by:
Hi, I know this question has prob. been asked a million times, but I couldn't find it in the FAQ, so here goes : I'm trying to write a Java applet to call a dll that resides on the web server...
1
by: Charlie Kim | last post by:
Here is gnome applet source of mine. -------------------------------------------------- #!/usr/bin/env python import pydic import gtk import gnome.applet
2
by: ManidipSengupta | last post by:
Hi, a few (3) questions for the Java experts, and let me know if this is the right forum. It deals with 100% java code (reason for posting here) but manages a Web browser with Javascript. Thanks in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.