[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Java3Djp:01636] Re: 直方体の幅変更
えんどうです。
>      tfield.addActionListener( new ActionListener() {
>        public void actionPerformed(ActionEvent e)  {
>          float value = 0.0f;
>          try {
>            value = Float.parseFloat(e.getActionCommand());
>            if (value > 1.0f) value = 1.0f;
>            if (value < 0.0f) value = 0.0f;
>            System.out.println("value=" + value);
> 
> →          bt3d.setScale(0.5);
多分これだけではダメで、btrans.setTransform(bt3d); とか
やらないといけないと思います。
より正確には、setScale() の直前で
  btrans.getTransform(bt3d);
をやっておき、
  bt3d.setScale(value);
  btrans.setTansform(bt3d);
こんな感じでしょうか。
> 
>          } catch (NumberFormatException ex) { }
>        }
>      });
>      panel.add(tfield);
-- 
ENDO Yasuyuki <yasuyuki@xxxxxxxxxxxx>
http://www.ss.iij4u.or.jp/~eyasuyuk/ (Personal/Japanese Only)
http://www.javaopen.org/jfriends/ (Japanese Only)