Momentan habe ich die TextArea von AWT drin, weil ich bei Swing das mit der Scollleiste nicht hinbekomme.
kann mir jemand helfen?
Ich weiß ne mehr weiter......
kann mir jemand helfen?
Ich weiß ne mehr weiter......
Code:
JPanel ptoben = new JPanel(new GridLayout(2,2));
JPanel ptmitte = new JPanel(new GridLayout(1,1));
JPanel ptunten = new JPanel(new GridLayout(1,4));
JLabel lcode = new JLabel("....");
JTextField tfcode = new JTextField();
//JPanel ptaEing = new JPanel(new GridLayout(1,1));
JLabel leing = new JLabel("Eingabe:");
TextArea taEing = new TextArea("",0,0,1);
//JPanel ptaAusg = new JPanel(new GridLayout(1,1));
JLabel lausg = new JLabel("Ausgabe:");
TextArea taAusg = new TextArea("",0,0,1);
Color col = new Color(240,240,240);
JButton btcod = new JButton("....");
JButton btdecod = new JButton(".....");
JButton btrnd = new JButton(".....");
JButton btexit = new JButton("....");
public Fenster()
{
this.setTitle("blabla");
this.setSize(700, 600);
//Fensterposition
final Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation( (d.width - getSize().width) / 2,
(d.height - getSize().height) / 2);
ptoben.add(lcode);ptoben.add(tfcode);
ptoben.add(leing);ptoben.add(lausg);
//ptaEing.add(taEing);ptaAusg.add(taAusg);
//ptmitte.add(ptaEing);ptmitte.add(ptaAusg);
ptmitte.add(taEing);ptmitte.add(taAusg);
ptunten.add(btcod);ptunten.add(btdecod);ptunten.add(btrnd);ptunten.add(btexit);
//JScrollPane erzeugen
/*JScrollPane scroll = new JScrollPane(ptaEing);
scroll.setCorner(
JScrollPane.UPPER_RIGHT_CORNER,
new JLabel("1", JLabel.CENTER)
);
scroll.setCorner(
JScrollPane.LOWER_RIGHT_CORNER,
new JLabel("2", JLabel.CENTER)
);
//JScrollPane erzeugen
JScrollPane scroll2 = new JScrollPane(ptaAusg);
scroll2.setCorner(
JScrollPane.UPPER_RIGHT_CORNER,
new JLabel("1", JLabel.CENTER)
);
scroll2.setCorner(
JScrollPane.LOWER_RIGHT_CORNER,
new JLabel("2", JLabel.CENTER)
);*/
//taEing.setLineWrap(true);
//taEing.setWrapStyleWord(true);
taAusg.setBackground(col);
taAusg.setEditable(false);
//taAusg.setWrapStyleWord(true);
//taAusg.setLineWrap(true);
//getContentPane().add(scroll, BorderLayout.CENTER);
//getContentPane().add(scroll2, BorderLayout.CENTER);
this.getContentPane().add(BorderLayout.NORTH, ptoben);
this.getContentPane().add(BorderLayout.CENTER, ptmitte);
this.getContentPane().add(BorderLayout.SOUTH, ptunten);