start
This commit is contained in:
parent
0893a80927
commit
9e6ae9604a
@ -17,8 +17,7 @@ public class Datail {
|
|||||||
public static DefaultTableModel detailmodel(int verein, String url) {
|
public static DefaultTableModel detailmodel(int verein, String url) {
|
||||||
String[][] temp = {{""}};
|
String[][] temp = {{""}};
|
||||||
DefaultTableModel t = new DefaultTableModel();
|
DefaultTableModel t = new DefaultTableModel();
|
||||||
System.out.println(verein);
|
System.out.println("test = "+verein);
|
||||||
|
|
||||||
|
|
||||||
try (Connection conn = DriverManager.getConnection(url, "root", "")) {
|
try (Connection conn = DriverManager.getConnection(url, "root", "")) {
|
||||||
ResultSet r = spieler(verein, conn);
|
ResultSet r = spieler(verein, conn);
|
||||||
|
@ -38,7 +38,8 @@ public class Einzelansicht extends JFrame implements TableModelListener, ActionL
|
|||||||
|
|
||||||
static JTable detail;
|
static JTable detail;
|
||||||
static JScrollPane dsc;
|
static JScrollPane dsc;
|
||||||
int vid = 1;
|
static int vid = 1;
|
||||||
|
static DefaultTableModel dtm = new DefaultTableModel();
|
||||||
|
|
||||||
|
|
||||||
public Einzelansicht(String ta) {
|
public Einzelansicht(String ta) {
|
||||||
@ -175,6 +176,13 @@ public class Einzelansicht extends JFrame implements TableModelListener, ActionL
|
|||||||
|
|
||||||
t.addTableModelListener(this);
|
t.addTableModelListener(this);
|
||||||
|
|
||||||
|
detail = new JTable(dtm);
|
||||||
|
detail.setAutoCreateRowSorter(true);
|
||||||
|
dsc = new JScrollPane(detail);
|
||||||
|
dsc.setBounds(20, 250, 550, 400);
|
||||||
|
dsc.getHorizontalScrollBar();
|
||||||
|
this.add(dsc);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +206,9 @@ public class Einzelansicht extends JFrame implements TableModelListener, ActionL
|
|||||||
}
|
}
|
||||||
t.addRow(rows);
|
t.addRow(rows);
|
||||||
t.fireTableDataChanged();
|
t.fireTableDataChanged();
|
||||||
|
vid = r.getInt(1);
|
||||||
|
detailtab(vid);
|
||||||
|
dtm.fireTableDataChanged();
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
@ -283,7 +294,6 @@ public class Einzelansicht extends JFrame implements TableModelListener, ActionL
|
|||||||
if (r.next()) {
|
if (r.next()) {
|
||||||
einfügen(r);
|
einfügen(r);
|
||||||
vid = r.getInt("V_ID");
|
vid = r.getInt("V_ID");
|
||||||
detailtab(vid);
|
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
@ -294,7 +304,6 @@ public class Einzelansicht extends JFrame implements TableModelListener, ActionL
|
|||||||
if (r.previous()) {
|
if (r.previous()) {
|
||||||
einfügen(r);
|
einfügen(r);
|
||||||
vid = r.getInt("V_ID");
|
vid = r.getInt("V_ID");
|
||||||
detailtab(vid);
|
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
@ -339,14 +348,13 @@ public class Einzelansicht extends JFrame implements TableModelListener, ActionL
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void detailtab(int vid) {
|
public static void detailtab(int vid) {
|
||||||
|
dtm = Datail.detailmodel(vid, url);
|
||||||
|
dtm.fireTableDataChanged();
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("detail ="+vid);
|
||||||
|
|
||||||
detail = new JTable(Datail.detailmodel(vid, url));
|
|
||||||
detail.setAutoCreateRowSorter(true);
|
|
||||||
dsc = new JScrollPane(detail);
|
|
||||||
dsc.setBounds(20, 250, 550, 400);
|
|
||||||
dsc.getHorizontalScrollBar();
|
|
||||||
this.add(dsc);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user