代碼書寫格式
<input type="text"/>; 最簡單的
如果你還需要更好看一些的,還可以寫一些css樣式
例如:
css樣式
如果還有什麼不懂,還提問我,希望我的回答,能幫到你
2. 怎麼在文字方塊上寫什麼內容就提示什麼內容<script language= "javascript">
<!--
function aa()
{
alert(document.form.a1.value);
}
//-->
</script>
<form name= "form">
<input type= "text" name= &qu長擔拜杆之訪瓣詩抱澗ot;a1">
<br>
<input type= "button" value= "onclick" onclick= "aa();">
</form>
要的是這個不?
3. JAVA輸入和輸出文字方塊怎麼寫,求解答import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.windowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class XXFrame extends JFrame implements ActionListener
{
private JTextField name = new JTextField("someone");
private JTextField text = new JTextField();
private JButton button = new JButton("輸入");
public XXFrame()
{
super("一個測試框框");
name.setBounds(40, 40, 200, 20);
button.setBounds(260, 40, 100, 20);
text.setBounds(40, 110, 200, 20);
this.setLayout(null);
this.setBounds(200, 200, 400, 400);
this.add(name);
this.add(button);
this.add(text);
this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(-1);
}
});
button.addActionListener(this);
this.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == button)
{
text.setText(name.getText());
}
}
public static void main(String[] args)
{
new XXFrame();
}
}