在这个按扭上点 在另一个文本框显示内容怎么写 事件 。。
另外在问一下有什么书上面全是正确工程代码 适合新手练习熟悉代码的书有没!

解决方案 »

  1.   


    function show(){
      document.getElementById("txt").value="^_^,我要显示内容了~o(∩_∩)o...哈哈";
    }<input type="text" id="txt" />
    <input type="button" value="我要显示文本" onclick="show()"/>
      

  2.   

    显示随机数:
    function show(){
      document.getElementById("txt").value=Math.random();//0-1之间随机浮点数
    }
      

  3.   

    比方说你按按扭 jButton1``在JTextField 显示``随机数字``
      

  4.   

    jButton1.addActionListener(new ActionListener(){
        public void ActionPerformed(ActionEvent ae){
            jTextField.setText(new Random().nextInt(10));//是这个意思么?显示1-10的随机数?
        }
    });