Re: how to set (preferred) JSlider length?



Here is the file foo.java:

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

public class foo extends JApplet {
public void init() {
setLayout(new BorderLayout());
add("Center", new JPanel());
JSlider s = new JSlider(0, 400);
add("East", s);
validate();
Dimension d = s.getSize();
d.width = 400;
s.setSize(d);
validate();
}
}

Here is the file foo.html:


<OBJECT
codetype="application/java"
code=foo.class
width=1024 height=1024


<PARAM NAME="cache_option" VALUE="No">

</OBJECT>



OK, then why is the slider 200 pixels wide, not 400???? Please
explain, thank you! Mark
.