当前位置: 代码迷 >> Java Web开发 >> textarea和 input 展示的有关问题
  详细解决方案

textarea和 input 展示的有关问题

热度:5358   发布时间:2013-02-25 21:16:30.0
textarea和 input 展示的问题
如题:左边想展示一个textarea 右边并列从上到下展示三个 input


望 知道的 告诉小弟,谢谢。

------解决方案--------------------------------------------------------

import java.awt.Button;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Label;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.List;

public class Boundary {
private Frame fWindow; //窗体
private TextField tStart; //text起点输入框
private TextField tEnd; //text终点输入框
private TextField tAdd; //text添加站点输入框
private TextField tfFirst; //text添加站点可直达的第一个站点输入框
private TextField tfSecond; //text添加站点可直达的第二个站点输入框
private TextField tfThird;
private TextField tfFourth;
private TextField tfFifth;

private TextField tZhanA;
private TextField tZhanB;
private TextField tDistance;
private TextField tMoney;

private Label labStart;
private Label labEnd;
private Label labAdd;
private Label labFirst;
private Label labSecond;
private Label labThird;
private Label labFourth;
private Label labFifth;

private Label labZhanA;
private Label labZhanB;
private Label labDistance;
private Label labMoney;

private Button bSeek; //查询路径
private Button bAdd; //添加站点

private Button bInput; //录入收费站之间收费路程距离,收费标准

private TextArea taResult; //多行的文本
private Dialog dWarn; //警告框
private Label labWarn;
private Button bWarn; //警告框按钮

private HignWay hignWay; //类对象


public Boundary()
{
init(); //初期化
}

public void init() {
fWindow = new Frame("江苏省高速公路路网行驶路径计算程序");
fWindow.setBounds(0, 0, 1280, 1000); //设置Frame x,y,width,height
fWindow.setBackground(Color.lightGray); //背景色
fWindow.setLayout(null); //清空布局管理器
labStart = new Label("起点");
labStart.setBounds(20, 650,25 ,20 );

tStart = new TextField();
tStart.setBounds(50, 650,300 ,20 );

labEnd = new Label("终点");
labEnd.setBounds(20, 680,25 ,20 );
tEnd = new TextField();
tEnd.setBounds(50, 680,300 ,20 );
bSeek = new Button("查询");
bSeek.setBounds(20, 710,80 ,30 );

taResult = new TextArea();
taResult.setBounds(10,35,1260,600 );

labAdd = new Label("新增站点");
labAdd.setBounds(390, 650,60 ,20 );
tAdd = new TextField();
tAdd.setBounds(460, 650,300 ,20 );
labFirst = new Label("直达站点1");
labFirst.setBounds(390, 680,60 ,20 );
tfFirst = new TextField();
tfFirst.setBounds(460, 680,300 ,20 );
labSecond = new Label("直达站点2");
labSecond.setBounds(390, 710,60 ,20 );
tfSecond = new TextField();
tfSecond.setBounds(460, 710,300 ,20 );
labThird = new Label("直达站点3");
labThird.setBounds(390, 740,60 ,20 );
tfThird = new TextField();
tfThird.setBounds(460, 740,300 ,20 );
labFourth = new Label("直达站点4");
labFourth.setBounds(390, 770,60 ,20 );
tfFourth = new TextField();
tfFourth.setBounds(460, 770,300 ,20 );
labFifth = new Label("直达站点5");
labFifth.setBounds(390, 800,60 ,20 );
tfFifth = new TextField();
tfFifth.setBounds(460, 800,300 ,20 );
bAdd = new Button("新增");
bAdd.setBounds(390, 830,80 ,30 );

dWarn = new Dialog(fWindow,"警告提示",true);
dWarn.setBounds(400,200,300,150); //x,y,width,height
dWarn.setLayout(new FlowLayout());
labWarn = new Label();
  相关解决方案