Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JTable probleme

Empfohlene Antworten

Veröffentlicht

Moin Jungs,

ich weiß einfach nicht mehr weiter -.-

Folgendes ... ich habe ne JTable mit nem DefaultTableModel ...

meine Tabelle soll hinterher dynamisch aus einem Vector erstellt werden der Vector ist wiefolgt aufgebaut ..

Vector vec = new Vector();

vec.add("A");

vec.add("A1");

vec.add("B");

vec.add("B1");

vec.add("C");

vec.add("C1");
Also A gehört quasi zu A1 :? die Tabelle soll dann dynamisch wie folgt aufgebaut werden |----------------------------------------| |Attribute A,B,C || Attribute A1,B1,C1| ------------------------------------------ | A || A1 | B || B1 | C || C1 ... .. . ich weiß nicht, wie ich das hinbekomme - ich sitze schon Stunden an der sch**** Das Problem, was sich bei mir ergab wenn ich den Vector einfach in die Methode
addRow()

gepackt habe, das nur A und A1 ausgegeben wurden ...

Vllt hat einer rat ...

Gruss der Onkel

Habs jetzt mit folgender Methode gelöst


private void setAttributeTableData(Vector vector, int breakPoint)

  {

    int row    = 0;

    int column = 0;


    tblModAttributes.setRowCount(vector.size() / breakPoint);


    for(int i=0; i<vector.size(); i++)

    {  

      tblModAttributes.setValueAt(vector.get(i),row,column);

      column++;


      if(i%breakPoint-1 == 0)

      {

        row++;

        column=0;

      }

    }    

  }

ich übergebe einen breakPoint z.B. 2 so sage ich nach 2 feldern, bitte ins nächste springen ... ist vllt. nicht schön, aber geht

gruss sven

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.