Hi all,
This isn't java3d but still I need it. I created a
JDialog and added its components without specifying
a layout because I couldn't get one to do as I wanted.
The problem is that it seems that the last component
added to the dialog takes the whole of it, regardless
of the bounds that are set for it.
here's the code... i hope one of you knows about this
issue.
Thanks
Frank B.
// code
public static void configure(JFrame owner, String title, boolean modal, Labo labo){
ModelOptions m = new ModelOptions(owner, title, modal, labo); // ModelOptions
extends JDialog
m.setSize(330, 360);
m.setResizable(false);
m.pane = new JTextPane();
m.pane.setEditable(false);
m.pane.setBounds(10,10,300,95);
String msg;
if(labo.dataBase.lang==0)
msg = "Veuillez scp�cifier les caract�ristiques du mod�le � charger."
+ "Le nom est un nom quelconque qui vous servira si choisissez de
d�charger "
+ "l'objet ult�rieurement. Si le nom choisi existe d�j�, le mod�le
existant sera remplac�.";
else
msg = "Please specify the following characteristics for the model to load."
+ "The name should be at your discretion and will serve as a
refference "
+ "whenever you wish to unload it. If the name is already used, the
existing model will be replaced.";
Style def = StyleContext.getDefaultStyleContext().
getStyle(StyleContext.DEFAULT_STYLE);
Style regular = m.pane.addStyle("regular", def);
StyleConstants.setFontFamily(def, "SansSerif");
Style s = m.pane.addStyle("red", regular);
StyleConstants.setForeground(s, Color.red);
s = m.pane.addStyle("black", regular);
StyleConstants.setForeground(s, Color.black);
m.doc = m.pane.getDocument();
m.pane.setBackground(new Color(0.75f,0.75f,0.75f));
try{
m.doc.insertString(m.doc.getLength(), msg, m.pane.getStyle("black"));
}catch(javax.swing.text.BadLocationException e){}
m.getContentPane().add(m.pane);
m.getContentPane().add(m.scaleLabel = new JLabel(labo.dataBase.lang == 0 ?
"�chelle: " : "Scale: "));
m.scaleLabel.setBounds(100,120,50,20);
m.getContentPane().add(m.scaleField = new JTextField("1"));
m.scaleField.setBounds(160,120,50,20);
m.getContentPane().add(m.xLabel = new JLabel("x: "));
m.xLabel.setBounds(100,150,50,20);
m.getContentPane().add(m.xField = new JTextField("0"));
m.xField.setBounds(160,150,50,20);
m.getContentPane().add(m.yLabel = new JLabel("y: "));
m.yLabel.setBounds(100,180,50,20);
m.getContentPane().add(m.yField = new JTextField("0"));
m.yField.setBounds(160,180,50,20);
m.getContentPane().add(m.zLabel = new JLabel("z: "));
m.zLabel.setBounds(100,210,50,20);
m.getContentPane().add(m.zField = new JTextField("0"));
m.zField.setBounds(160,210,50,20);
m.getContentPane().add(m.modelNameLabel = new
JLabel(labo.dataBase.lang==0?"Nom: ":"Name: "));
m.modelNameLabel.setBounds(100,240,50,20);
m.getContentPane().add(m.modelName = new JTextField("name"));
m.modelName.setBounds(160,240,80,20);
m.modelName.addFocusListener(m);
m.getContentPane().add(m.okModel = new JButton("Ok"));
m.okModel.setBounds(105,260,5,5);
m.getContentPane().add(m.cancelModel = new JButton(labo.dataBase.lang==0 ?
"Annuler" : "Cancel"));
m.cancelModel.setBounds(155,260,5,5);
m.modelName.selectAll();
m.okModel.addActionListener(m);
m.cancelModel.addActionListener(m);
m.show();
}
Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".