Ist mir echt peinlich, aber kann mir BITTE jemand ne Scrollbar zu meiner Textarea adden?
Und bitte keine Links zur API o.ä.. Ist ja nicht so, dass ich nich seit eineinhalb Stunden google.
Danke!!
Martin
Und bitte keine Links zur API o.ä.. Ist ja nicht so, dass ich nich seit eineinhalb Stunden google.
Java:
public class OptionChange extends JFrame implements ActionListener {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
static XMLread xml = new XMLread(); // @jve:decl-index=0:
/** JTextArea tasource */
public static JTextArea tasource = null;
/** JButton btok */
public static JButton btok = null;
public static JList OptionList = null;
public static DefaultListModel dlm = new DefaultListModel();
public static JLabel lb_img_ok = null;
public static String changedvalue=""; // @jve:decl-index=0:
/**
* This is the default constructor
*/
public OptionChange() {
super();
initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
//this.getContentPane().add(sbrText);
this.setContentPane(getJContentPane());
this.setSize(956, 569);
ImageIcon icon = new ImageIcon("images/application_form_magnify.png");
this.setIconImage(icon.getImage());
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int width = (int) d.getWidth();
int height = (int) d.getHeight();
width = (width - this.getWidth()) / 2;
height = (height - this.getHeight()) / 2;
this.setLocation(width, height);
this.setTitle("Option bearbeiten");
btok.setText("Übernehmen");
this.setVisible(true);
getOptionList();
this.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
window_closing(e);
}}
);
}
/**
* The Methode which closes the JFrame<br>
* Diese Methode schließ den JFrame
*
* @param e
*/
protected void window_closing(WindowEvent e) {
this.setVisible(false);
}
/**
* This method initializes jContentPane<br>
* Diese Methode erzeugt jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(gettasource(), null);
jContentPane.add(getBtok(), null);
jContentPane.add(getOptionList(), null);
jContentPane.add(getLb_img_ok(), null);
}
return jContentPane;
}
/**
* This method initializes tfpfad<br>
* Diese Methode erzeugt tfpfad
*
* @return javax.swing.JTextArea
*/
public static JTextArea gettasource() {
if (tasource == null) {
tasource = new JTextArea();
tasource.setLineWrap(true);
tasource.setBounds(new Rectangle(6, 15, 689, 517));
tasource.setText(null);
tasource.setEditable(true);
}
return tasource;
}
/**
* This method initializes btok<br>
* Diese Methode erzeugt btok
*
* @return javax.swing.JButton
*/
public JButton getBtok() {
if (btok == null) {
btok = new JButton();
btok.setBounds(new Rectangle(730, 20, 118, 25));
btok.setText("Übernehmen");
btok.setActionCommand("speichern");
btok.addActionListener(this);
}
return btok;
}
// usw....
Danke!!
Martin
Zuletzt bearbeitet von einem Moderator: