T
Toni@frust
Gast
So ich hab mir ne Tabelle gebastelt, die funst auch!
Nur hab ich das kleine Problem mit dem speichern des Inhaltes in ne Textdatei zum Beipiel.
Quellcode -->
so bei String userIn; soll sowas wie in der Richtung --> userIn = table.getText(); hin oder table.getValue(); ...
aber das hab ich schon ausprobiert und das funst ned !!
habt ihr ne Idee?
Nur hab ich das kleine Problem mit dem speichern des Inhaltes in ne Textdatei zum Beipiel.
Quellcode -->
Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Table extends JFrame implements TableData
{
JTable table;
public Table()
{
super("Tabellen Formular");
addWindowListener(new WindowClosingAdapter(true));
table = new JTable(DATA, COLHEADS);
table.setRowSelectionAllowed(false);
Container cp = getContentPane();
JButton speichern = new JButton("speichern");
cp.add(speichern, BorderLayout.SOUTH);
speichern.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
speichernActionPerformed(evt);
}
});
cp.add(new JLabel("CD_DVD-Datenbank:"), BorderLayout.NORTH);
cp.add(new JScrollPane(table), BorderLayout.CENTER);
}
public void speichernActionPerformed(ActionEvent evt) {
String userIn;
}
public static void main(String[] args)
{
Table frame = new Table();
frame.setLocation(100, 100);
frame.setSize(700, 400);
frame.setVisible(true);
}
}
so bei String userIn; soll sowas wie in der Richtung --> userIn = table.getText(); hin oder table.getValue(); ...
aber das hab ich schon ausprobiert und das funst ned !!
habt ihr ne Idee?