/ Forside / Teknologi / Udvikling / Java / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Java
#NavnPoint
molokyle 3688
Klaudi 855
strarup 740
Forvirret 660
gøgeungen 500
Teil 373
Stouenberg 360
vnc 360
pmbruun 341
10  mccracken 320
panel placering
Fra : ole


Dato : 04-02-01 01:03

Hej jeg vil gerne have de to panel i denne JApplet til at blive siddende i
øverste venstre hjørne. de finder tilsynladede altid midten, hvordan får jeg
dem til at blive i øverste højre hjørne.

kode


/*
* GuitarScalerGui.java
*
* Created on 3. februar 2001, 23:49
*/


/**
*
* @author lord x
* @version
*/
public class GuitarScalerGui extends javax.swing.JApplet


/** Creates new form GuitarScalerGui */
public GuitarScalerGui()

setSize(400,800);


initComponents ();
}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
jPanel1 = new javax.swing.JPanel();
jCheckBox2 = new javax.swing.JCheckBox();
jCheckBox3 = new javax.swing.JCheckBox();
jCheckBox4 = new javax.swing.JCheckBox();
jCheckBox5 = new javax.swing.JCheckBox();
jCheckBox6 = new javax.swing.JCheckBox();
jCheckBox7 = new javax.swing.JCheckBox();
jCheckBox8 = new javax.swing.JCheckBox();
jCheckBox9 = new javax.swing.JCheckBox();
jCheckBox10 = new javax.swing.JCheckBox();
jCheckBox11 = new javax.swing.JCheckBox();
jCheckBox12 = new javax.swing.JCheckBox();
jPanel2 = new javax.swing.JPanel();
jComboBox1 = new javax.swing.JComboBox();
jButton1 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
getContentPane().setLayout(new java.awt.GridBagLayout());
java.awt.GridBagConstraints gridBagConstraints1;

jPanel1.setLayout(new java.awt.GridBagLayout());
java.awt.GridBagConstraints gridBagConstraints2;
jPanel1.setBorder(new javax.swing.border.TitledBorder("Tone"));

jCheckBox2.setText("E");
gridBagConstraints2 = new java.awt.GridBagConstraints();
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.ipadx = 11;
gridBagConstraints2.insets = new java.awt.Insets(3, 12, 3, 9);
gridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST;
jPanel1.add(jCheckBox2, gridBagConstraints2);


jCheckBox3.setText("F");
gridBagConstraints2 = new java.awt.GridBagConstraints();
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 1;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.Insets(3, 12, 3, 9);
jPanel1.add(jCheckBox3, gridBagConstraints2);


jCheckBox4.setText("F#");
gridBagConstraints2 = new java.awt.GridBagConstraints();
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 2;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.Insets(3, 12, 3, 9);
gridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST;
jPanel1.add(jCheckBox4, gridBagConstraints2);


jCheckBox5.setText("G");
gridBagConstraints2 = new java.awt.GridBagConstraints();
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 3;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.Insets(3, 12, 3, 9);
jPanel1.add(jCheckBox5, gridBagConstraints2);


jCheckBox6.setText("G#");
gridBagConstraints2 = new java.awt.GridBagConstraints();
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 4;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.

 
 
Esben Mose Hansen (24-02-2001)
Kommentar
Fra : Esben Mose Hansen


Dato : 24-02-01 14:43

ole wrote:

> Hej jeg vil gerne have de to panel i denne JApplet til at blive siddende i
> øverste venstre hjørne. de finder tilsynladede altid midten, hvordan får jeg
> dem til at blive i øverste højre hjørne.
>

Ovenstående er lidt uforståeligt, men svaret ligger nok i at bruge en
layoutmanager. De er der til det samme. Prøv GridLayout ...

mvh. Esben


Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408929
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste