Swing jTable und AbstractTableModel

kneubi

Mitglied
Hallo zusammen

Vorabinformation:
Ich nutze Eclipse Indigo und programmiere mit jre/jdk1.6 auf einem MacbookPro. Im Eclipse habe ich das Plugin Jigloo integriert welches mir bei meinen anfänglichen GUI-Schritten sehr hilft... gemäss Internet läuft es mit Swing/SWT.

Nun zum Problem:

Ich kämpfe nun schon seit gut drei Tagen mit meinem Javaprogramm... es hat alles soweit wie gewollt funktioniert. Nun ist mir aber die Idee gekommen im "HauptGUI" könnte ich eigentlich auch noch eine jTable erstellen anstatt eine jList, also habe ich die jList ausgetauscht und fleissig angefangen überall den Code anzupassen... die jTable in dieser Form verwende ich bereits bei einem weiteren Fenster das zusätzlich aufgerufen wird, allerdings habe ich beim Aufbauen des GUIs kein Problem da ich dort bereits Daten mitgeben kann. Auf dem HauptGUI kann ich dies aber nicht. Die jTables werden mit einer eigenen Klasse gefüttert die das AbstractTableModel extended.

Und im Voraus entschuldigt bitte den seeeeeeeeehr schlechten Code im Auge eines professionellen Programmierers.. ich habe vor 2 Monaten mit Java wieder angefangen, hatte davor etwas Erfahrung mit Programmieren mit VB.NET und habe einen 3 Tage Crashkurs Java hinter mir. Der Code ist entstanden aus Ideen, Java-lern-ebooks lesen und im Internet nachschlagen wie man es lösen könnte.

Hier erstmal der Code:
Ich habe 2 Packages:

_____Package1: Daten_____
Class: Army
Java:
package Daten;

import java.util.ArrayList;

public class Army {
	public String strArmyName;
	public Boolean bolFlying = false;
	public Boolean bolMechanized = false;
	public Boolean bolTired = false;
	public Boolean bolFortified = false;
	public Boolean bolVigliant = false;
	public Boolean bolAntiScouting = false;
	public Boolean bolUnderArtilleryFire = false;
	public Boolean bolWithoutHQ = false;
	public Integer intArmyPointCosts;
	public Integer intArmyMovment;
	public Integer intArmySight;
	public ArrayList<Unit> alUnit = new ArrayList<Unit>();
	
	public Army(){
		
	}
	
	public Army(String newArmy){
		strArmyName = newArmy;
	}
	
	public String toString(){
		return strArmyName;
	}
	
	public void addUnit(String UnitAdd){
//		Integer i;
		Unit objUnit = new Unit(UnitAdd);
		alUnit.add(objUnit);
//		Object ai[] = alUnit.toArray();
//		for (i = 0; i < ai.length; i++){
//			System.out.println(ai[i]);
//		}
	}

	public Boolean getBolFlying() {
		return bolFlying;
	}

	public void setBolFlying(Boolean bolFlying) {
		this.bolFlying = bolFlying;
	}

	public Boolean getBolMechanized() {
		return bolMechanized;
	}

	public void setBolMechanized(Boolean bolMechanized) {
		this.bolMechanized = bolMechanized;
	}

	public Boolean getBolTired() {
		return bolTired;
	}

	public void setBolTired(Boolean bolTired) {
		this.bolTired = bolTired;
	}

	public Boolean getBolFortified() {
		return bolFortified;
	}

	public void setBolFortified(Boolean bolFortified) {
		this.bolFortified = bolFortified;
	}

	public Boolean getBolVigliant() {
		return bolVigliant;
	}

	public void setBolVigliant(Boolean bolVigliant) {
		this.bolVigliant = bolVigliant;
	}

	public Boolean getBolAntiScouting() {
		return bolAntiScouting;
	}

	public void setBolAntiScouting(Boolean antiScouting) {
		bolAntiScouting = antiScouting;
	}

	public Boolean getBolUnderArtilleryFire() {
		return bolUnderArtilleryFire;
	}

	public void setBolUnderArtilleryFire(Boolean bolUnderArtilleryFire) {
		this.bolUnderArtilleryFire = bolUnderArtilleryFire;
	}

	public Boolean getBolWithoutHQ() {
		return bolWithoutHQ;
	}

	public void setBolWithoutHQ(Boolean bolWithoutHQ) {
		this.bolWithoutHQ = bolWithoutHQ;
	}	

}

Class: Equipment
Java:
package Daten;


public class Equipment {
	public String strEquipmentName;
	public Integer intEquipmentPointCosts;
	
	public Equipment(String newUnit){
		strEquipmentName = newUnit;
	}
	
	public Equipment(String newUnit, Integer newEquipmentCosts){
		strEquipmentName = newUnit;
		intEquipmentPointCosts = newEquipmentCosts;
	}

	public String getStrEquipmentName() {
		return strEquipmentName;
	}

	public void setStrEquipmentName(String strEquipmentName) {
		this.strEquipmentName = strEquipmentName;
	}

	public Integer getIntEquipmentPointCosts() {
		return intEquipmentPointCosts;
	}

	public void setIntEquipmentPointCosts(Integer intEquipmentPointCosts) {
		this.intEquipmentPointCosts = intEquipmentPointCosts;
	}
	
	
}

Class: MyTableModel
Java:
package Daten;

import java.util.List;
import javax.swing.table.AbstractTableModel;
 
/**
 *
 * @author sash
 */
public class MyTableModel extends AbstractTableModel{
 
    private static final String[] HEADER = {"Slot", "Unitname", "Points", "Flying", "Mechanized", "Equipment"};
    private List<Unit> data;
    public Integer IntDataSize;

    public MyTableModel() {

    }
    
    public MyTableModel(List<Unit> data) {
        this.data = data;
    }
 
 
 
    public int getRowCount() {
    		return data.size();
    }
 
    public int getColumnCount() {
        return HEADER.length;
    }
 
    public Object getValueAt(int row, int column) {
        Unit unit = data.get(row);
 
        switch(column){
            case 0: return unit.getStrSlot();
            case 1: return unit.getStrUnitName();
            case 2: return unit.getIntPointCosts();
            case 3: return unit.getBolFlying();
            case 4: return unit.getBolMechanized();
            default: return "";
        }
    }
 
    @Override
    public String getColumnName(int column) {
        return HEADER[column];
    }
 
// Hier kann man die Klasse für eine Spalte ändern. 
    @Override
    public Class<?> getColumnClass(int column) {
        if(column == 3){
            return Boolean.class;
        }
        if(column == 4){
            return Boolean.class;
        }
        if(column == 5){
            return Boolean.class;
        }
        return super.getColumnClass(column);
    }
 
 
}

Class: Player
Java:
package Daten;

import java.util.ArrayList;


public class Player {
	public String strPlayerName;
	public String strFelderory[];
	public String strArmysory[];
	public int intIAP;
	public String strIAPHistory[];
	public int intTAP;
	public String strTAPHistory[];
	public int intKP;
	public String strKPHistory[];
	public int intSP;
	public String strSPHistory[];
	public int intSTP;
	public String strSTPHistory[];
	public ArrayList<Army> alArmy = new ArrayList<Army>();
	
	public Player() {
	}
	
	public Player(String newPlayer) {
		strPlayerName = newPlayer;
	}
	
	public String getStrPlayerName() {
		return strPlayerName;
	}

	public void setStrPlayerName(String strPlayerName) {
		this.strPlayerName = strPlayerName;
	}

	public int getIntIAP() {
		return intIAP;
	}

	public void setIntIAP(int intIAP) {
		this.intIAP = intIAP;
	}

	public int getIntTAP() {
		return intTAP;
	}

	public void setIntTAP(int intTAP) {
		this.intTAP = intTAP;
	}

	public int getIntKP() {
		return intKP;
	}

	public void setIntKP(int intKP) {
		this.intKP = intKP;
	}

	public int getIntSP() {
		return intSP;
	}

	public void setIntSP(int intSP) {
		this.intSP = intSP;
	}

	public int getIntSTP() {
		return intSTP;
	}

	public void setIntSTP(int intSTP) {
		this.intSTP = intSTP;
	}

	public String toString() {
		return strPlayerName;
	}
	
	public void addArmy(String ArmyAdd){
		Army objArmy = new Army(ArmyAdd);
		alArmy.add(objArmy);
	}
	
	public void deleteAllArmys(){
		Integer i;
		for (i = 0; i < alArmy.toArray().length; i++) {
			alArmy.remove(i);
		}
			
	}
	
	public void deleteOneArmy(Object y){
			alArmy.remove(y);
			
	}
}

Class: Unit
Java:
package Daten;


public class Unit {


	public String strUnitName;
	public Integer intPointCosts = 0;
	public Boolean bolFlying = false;
	public Boolean bolMechanized = false;
	public String strSlot;
	public String strAllInfo;
	public Integer intBasicPointCosts = 0;
	public Integer intEquipmentCosts = 0;
	
    

	public Unit(String newUnit){
		strUnitName = newUnit;
	}
	
	public Unit(String newUnit, String newUnitSlotObject, Integer newUnitCosts){
		strUnitName = newUnit;
		intPointCosts = newUnitCosts;
		strSlot = newUnitSlotObject.toString();
	}
	
	public Unit(String newUnit, String newUnitSlotObject, Integer newUnitCosts, Boolean newBolFlying, Boolean newBolMechanized){
		strUnitName = newUnit;
		intBasicPointCosts = newUnitCosts;
		strSlot = newUnitSlotObject.toString();
		bolFlying = newBolFlying;
		bolMechanized = newBolMechanized;
		intPointCosts = intBasicPointCosts + intEquipmentCosts;
	}
	
	public String toString(){
		return strUnitName;
	}
	
	public String toStringAll(){
		strAllInfo = strSlot + "--" + strUnitName + "--" + intPointCosts + "-- Flying " + bolFlying + "-- Mechanized " + bolMechanized;
		return strAllInfo;
	}
	
	public Boolean getBolFlying() {
		return bolFlying;
	}

	public void setBolFlying(Boolean bolFlying) {
		this.bolFlying = bolFlying;
	}

	public Boolean getBolMechanized() {
		return bolMechanized;
	}

	public void setBolMechanized(Boolean bolMechanized) {
		this.bolMechanized = bolMechanized;
	}

	public String getStrSlot() {
		return strSlot;
	}

	public void setStrSlot(String strSlot) {
		this.strSlot = strSlot;
	}

	public String getStrUnitName() {
		return strUnitName;
	}
	
	public void setStrUnitName(String strUnitName) {
		this.strUnitName = strUnitName;
	}
	
	public Integer getIntPointCosts() {
		return intPointCosts;
	}

	public void setIntPointCosts(Integer intPointCosts) {
		this.intPointCosts = intPointCosts;
	}
	
	public Integer getIntBasicPointCosts() {
		return intBasicPointCosts;
	}

	public void setIntBasicPointCosts(Integer intBasicPointCosts) {
		this.intBasicPointCosts = intBasicPointCosts;
	}

	public Integer getIntEquipmentCosts() {
		return intEquipmentCosts;
	}

	public void setIntEquipmentCosts(Integer intEquipmentCosts) {
		this.intEquipmentCosts = intEquipmentCosts;
	}

}



Beim starten des MainGUI's erscheint nun die Fehlermeldung dass er mir die getRowCount() von meinem MyTableModel nicht aufrufen kann, ist ja eigentlich auch logich weil die Liste im Instanzierten Model leer ist. Aber ich habe keine Daten hier zu übergeben, ich habe bereits mit IF-Abfragen versucht alles abzufangen und ein Returnwert von "0" zu geben bei getRowCount() aber da hat es ebenso ein Fehler gespuckt... Gibts eine elegantere Lösung?

Ich will beim Aufbauen des GUIs einfach eine jTable mit den Spaltenüberschriften aber noch keine Daten darin, doch wie kriege ich das mit einem AbstractTableModel hin?

Gruss
Kneubi
 
Zuletzt bearbeitet:

kneubi

Mitglied
____Package2: GUI____

Class:MainGUI ------- Teil1
Java:
package GUI;
import java.awt.event.*;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListModel;
import java.util.*;

import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import org.jdesktop.layout.GroupLayout;
import org.jdesktop.layout.LayoutStyle;

import Daten.MyTableModel;
import Daten.Player;
import Daten.Unit;
import GUI.UnitAddGUI;

import javax.swing.SwingUtilities;


public class MainGUI extends javax.swing.JFrame implements ActionListener{

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	public JTextField jtxtPlayerAdd;
	public JButton jcmdPlayerAdd;
	public ArrayList<Player> alPlayer = new ArrayList<Player>();
	public JComboBox jcbPlayer;
	public JButton jcmdArmyAdd;
	public static JTextField jtxtArmyAdd;
    private JCheckBox jchbFlying;
    private JTable jtblArmyView;
    private JButton jcmdUnitAdd;
    private JPanel jpArmyAttribues;
    private JScrollPane jspArmyView;
    private JButton jcmdPlayerRemove;
    private JButton jcmdArmyMerge;
    private JComboBox jcbPlayerArmyList2;
    private JCheckBox jchbWithoutHQ;
    private JCheckBox jchbUnderArtilleryFire;
    private JCheckBox jchbAntiScouting;
    private JCheckBox jchbMechanized;
    private JButton jcmdArmyRemove;
    private JCheckBox jchbTired;
    private JCheckBox jchbVigliant;
    private JCheckBox jchbFortified;
    private JComboBox jcbPlayerArmyList;
    public Integer intSelectedPlayer;
    public Integer intSelectedArmy;
    public ArrayList<DefaultListModel> alListModel = new ArrayList<DefaultListModel>();
    public ArrayList<MyTableModel> alMainGUITableModel = new ArrayList<MyTableModel>();
    

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				MainGUI inst = new MainGUI();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public MainGUI() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			//Textbox
			{
				jtxtPlayerAdd = new JTextField();
			}
			{
				jtxtArmyAdd = new JTextField();
			}
			
			//Button
			{
				jcmdPlayerAdd = new JButton();
				jcmdPlayerAdd.setText("Add Player");
				jcmdPlayerAdd.addActionListener(this);
			}
			{
				jcmdPlayerRemove = new JButton();
				jcmdPlayerRemove.setText("Remove Player");
				jcmdPlayerRemove.addActionListener(this);
			}
			{
				jcmdArmyAdd = new JButton();
				jcmdArmyAdd.setText("Add Army");
				jcmdArmyAdd.addActionListener(this);
			}
			{
				jcmdArmyRemove = new JButton();
				jcmdArmyRemove.setText("Remove Army");
				jcmdArmyRemove.addActionListener(this);
			}
			{
				jcmdArmyMerge = new JButton();
				jcmdArmyMerge.setText("Merge Army with");
				jcmdArmyMerge.addActionListener(this);
			}
			{
				jcmdUnitAdd = new JButton();
				jcmdUnitAdd.setText("Add Unit");
				jcmdUnitAdd.addActionListener(this);
			}
			
			//Checkboxen + JPanel
			{
				jpArmyAttribues = new JPanel();
				{
					jchbFlying = new JCheckBox();
					jpArmyAttribues.add(jchbFlying);
					jchbFlying.setText("Flying");
					jchbFlying.setPreferredSize(new java.awt.Dimension(174, 19));
					jchbFlying.addActionListener(this);
				}
				{
					jchbMechanized = new JCheckBox();
					jpArmyAttribues.add(jchbMechanized);
					jchbMechanized.setText("Mechanized");
					jchbMechanized.setPreferredSize(new java.awt.Dimension(174, 19));
					jchbMechanized.setSize(174, 19);
					jchbMechanized.addActionListener(this);
				}
				{
					jchbTired = new JCheckBox();
					jpArmyAttribues.add(jchbTired);
					jchbTired.setText("Tired");
					jchbTired.setPreferredSize(new java.awt.Dimension(174, 19));
					jchbTired.addActionListener(this);
				}
				{
					jchbFortified = new JCheckBox();
					jpArmyAttribues.add(jchbFortified);
					jchbFortified.setText("Fortified");
					jchbFortified.setPreferredSize(new java.awt.Dimension(174, 19));
					jchbFortified.addActionListener(this);
				}
				{
					jchbVigliant = new JCheckBox();
					jpArmyAttribues.add(jchbVigliant);
					jchbVigliant.setText("Vigliant");
					jchbVigliant.setPreferredSize(new java.awt.Dimension(174, 19));
					jchbVigliant.addActionListener(this);
				}
				{
					jchbAntiScouting = new JCheckBox();
					jpArmyAttribues.add(jchbAntiScouting);
					jchbAntiScouting.setText("Anti scouting");
					jchbAntiScouting.setPreferredSize(new java.awt.Dimension(174, 19));
					jchbAntiScouting.addActionListener(this);
				}
				{
					jchbUnderArtilleryFire = new JCheckBox();
					jpArmyAttribues.add(jchbUnderArtilleryFire);
					jchbUnderArtilleryFire.setText("Under artillery fire");
					jchbUnderArtilleryFire.setPreferredSize(new java.awt.Dimension(174, 19));
					jchbUnderArtilleryFire.addActionListener(this);
				}
				{
					jchbWithoutHQ = new JCheckBox();
					jpArmyAttribues.add(jchbWithoutHQ);
					jchbWithoutHQ.setText("Without HQ");
					jchbWithoutHQ.setPreferredSize(new java.awt.Dimension(174, 17));
					jchbWithoutHQ.addActionListener(this);
				}
			}

			//ScrollPanel + Listbox ArmyView
			{
				jspArmyView = new JScrollPane();
				{
					MyTableModel MainGUITableModel = 
							new MyTableModel();
					alMainGUITableModel.add(MainGUITableModel);
					jtblArmyView = new JTable();
					jspArmyView.setViewportView(jtblArmyView);
					jtblArmyView.setModel(MainGUITableModel);
					jtblArmyView.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
					jtblArmyView.getColumn("Slot").setPreferredWidth(60);
					jtblArmyView.getColumn("Unitname").setPreferredWidth(407);
					jtblArmyView.getColumn("Points").setPreferredWidth(80);
					jtblArmyView.getColumn("Flying").setPreferredWidth(50);
					jtblArmyView.getColumn("Mechanized").setPreferredWidth(80);	
				}
			}
			
			//Combobox
			{
				ComboBoxModel jcbPlayerModel = 
						new DefaultComboBoxModel(
								new String[] {});
				jcbPlayer = new JComboBox();
				jcbPlayer.setModel(jcbPlayerModel);
				jcbPlayer.addActionListener(this);
			}
			{
				ComboBoxModel jcbPlayerArmyListModel = 
						new DefaultComboBoxModel(
								new String[] { });
				jcbPlayerArmyList = new JComboBox();
				jcbPlayerArmyList.setModel(jcbPlayerArmyListModel);
				jcbPlayerArmyList.addActionListener(this);
			}

			{
				ComboBoxModel jcbPlayerArmyList2Model = 
						new DefaultComboBoxModel(
								new String[] { "" });
				jcbPlayerArmyList2 = new JComboBox();
				jcbPlayerArmyList2.setModel(jcbPlayerArmyList2Model);
			}
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
				.addContainerGap()
				.add(thisLayout.createParallelGroup(GroupLayout.BASELINE)
				    .add(GroupLayout.BASELINE, jcmdPlayerAdd, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.BASELINE, jtxtPlayerAdd, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.RELATED)
				.add(thisLayout.createParallelGroup(GroupLayout.BASELINE)
				    .add(GroupLayout.BASELINE, jcbPlayer, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.BASELINE, jcmdPlayerRemove, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.RELATED)
				.add(thisLayout.createParallelGroup(GroupLayout.BASELINE)
				    .add(GroupLayout.BASELINE, jcmdArmyAdd, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.BASELINE, jtxtArmyAdd, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.RELATED)
				.add(thisLayout.createParallelGroup(GroupLayout.BASELINE)
				    .add(GroupLayout.BASELINE, jcbPlayerArmyList2, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.BASELINE, jcmdUnitAdd, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.BASELINE, jcmdArmyMerge, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.BASELINE, jcbPlayerArmyList, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.BASELINE, jcmdArmyRemove, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.RELATED)
				.add(thisLayout.createParallelGroup()
				    .add(thisLayout.createSequentialGroup()
				        .add(jpArmyAttribues, GroupLayout.PREFERRED_SIZE, 195, GroupLayout.PREFERRED_SIZE))
				    .add(thisLayout.createSequentialGroup()
				        .add(jspArmyView, GroupLayout.PREFERRED_SIZE, 194, GroupLayout.PREFERRED_SIZE)))
				.addContainerGap(127, Short.MAX_VALUE));
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
				.addContainerGap()
				.add(thisLayout.createParallelGroup()
				    .add(GroupLayout.LEADING, jpArmyAttribues, GroupLayout.PREFERRED_SIZE, 190, GroupLayout.PREFERRED_SIZE)
				    .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
				        .add(jcbPlayerArmyList, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE)
				        .add(10))
				    .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
				        .add(jtxtArmyAdd, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE)
				        .add(10))
				    .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
				        .add(jcbPlayer, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE)
				        .add(10))
				    .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
				        .add(jtxtPlayerAdd, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE)
				        .add(10)))
				.add(thisLayout.createParallelGroup()
				    .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
				        .add(jspArmyView, GroupLayout.PREFERRED_SIZE, 555, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.RELATED, 0, Short.MAX_VALUE))
				    .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
				        .add(thisLayout.createParallelGroup()
				            .add(GroupLayout.LEADING, jcmdArmyRemove, 0, 131, Short.MAX_VALUE)
				            .add(thisLayout.createSequentialGroup()
				                .add(jcmdArmyAdd, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
				                .add(0, 0, Short.MAX_VALUE))
				            .add(thisLayout.createSequentialGroup()
				                .add(jcmdPlayerRemove, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
				                .add(0, 0, Short.MAX_VALUE))
				            .add(thisLayout.createSequentialGroup()
				                .add(jcmdPlayerAdd, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
				                .add(0, 0, Short.MAX_VALUE)))
				        .addPreferredGap(LayoutStyle.RELATED)
				        .add(jcmdUnitAdd, 0, 94, Short.MAX_VALUE)
				        .addPreferredGap(LayoutStyle.RELATED)
				        .add(jcmdArmyMerge, GroupLayout.PREFERRED_SIZE, 133, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.RELATED)
				        .add(jcbPlayerArmyList2, GroupLayout.PREFERRED_SIZE, 186, GroupLayout.PREFERRED_SIZE)))
				.addContainerGap(89, 89));

			//Layoutsetzen
			pack();
			this.setSize(850, 469);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
		
	}
	
	
	public void actionPerformed(ActionEvent e){
		if (e.getSource() == jcmdPlayerAdd) {
			addPlayer();
		}if (e.getSource() == jcmdPlayerRemove) {
			removePlayer();
		}if (e.getSource() == jcmdArmyAdd) {
			addArmy();
		}if(e.getSource() == jcmdArmyRemove){
			removeArmy();
		}if (e.getSource() == jcmdArmyMerge) {
			mergeArmy();
		} if (e.getSource() == jcmdUnitAdd){
			addUnit();
		} if (e.getSource() == jcbPlayer) {
			changeJcbPlayer();
		} if (e.getSource() == jcbPlayerArmyList) {
			changeJcbPlayerArmyList();
		}if (e.getSource() == jchbFlying) {
			changeFlying();
		}if (e.getSource() == jchbMechanized) {
			changeMechanized();
		}if (e.getSource() == jchbTired) {
			changeTired();
		}if (e.getSource() == jchbFortified) {
			changeFortified();
		}if (e.getSource() == jchbVigliant) {
			changeVigliant();
		}if (e.getSource() == jchbAntiScouting) {
			changeAntiScounting();
		}if (e.getSource() == jchbUnderArtilleryFire) {
			changeUnderArtilleryFire();
		}if (e.getSource() == jchbWithoutHQ) {
			changeWithoutHQ();
		}
	}



	void addPlayer() {
		Integer i;
		if (jtxtPlayerAdd.getText().length() >0 ) {
			String txtContextPlayerAdd = jtxtPlayerAdd.getText();
			jcbPlayer.removeAllItems();
			Player objPlayer = new Player(txtContextPlayerAdd);
			alPlayer.add(objPlayer);
			Object ia[] = alPlayer.toArray();
			for (i=0;i<ia.length; i++){
				jcbPlayer.addItem(ia[i]);	
			}
			jtxtPlayerAdd.setText("");
		}else {
			JOptionPane.showMessageDialog(null, "Es konnte kein Spieler angelegt werden da Sie keinen Spielernamen angegeben haben.", "Kein Spielername eingegeben!", JOptionPane.ERROR_MESSAGE);
			
		}
	}
	
	void removePlayer(){
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayer.getItemCount() == 1){
				Integer x;
				x = jcbPlayer.getSelectedIndex();
				jcbPlayer.removeAllItems();
				jcbPlayerArmyList.removeAllItems();
				jcbPlayerArmyList2.removeAllItems();
				if (alPlayer.get(x).alArmy.size() > 0){
					alPlayer.get(x).deleteAllArmys();
				}
				alPlayer.removeAll(alPlayer);
			}else{
				Integer x;
				Integer y;
				Integer i;
				Integer j;
				x = jcbPlayer.getSelectedIndex();
				if (alPlayer.get(x).alArmy.size() > 0){
					alPlayer.get(x).deleteAllArmys();
				}
				alPlayer.remove(alPlayer.get(x));
				jcbPlayer.removeAllItems();
				Object ai1[] = alPlayer.toArray();
				for (j = 0; j < ai1.length; j++){
					jcbPlayer.addItem(ai1[j]);
				}
				y = jcbPlayer.getSelectedIndex();
				if (alPlayer.get(y).alArmy.size() > 0){
					jcbPlayerArmyList.removeAllItems();
					jcbPlayerArmyList2.removeAllItems();
					Object ai2[] = alPlayer.get(y).alArmy.toArray();
					for (i=0; i <ai2.length; i++){
						jcbPlayerArmyList.addItem(ai2[i]);
						jcbPlayerArmyList2.addItem(ai2[i]);
					}
				}
			}
		}
		else{
			JOptionPane.showMessageDialog(null, "Es ist kein Spieler vorhanden den man löschen könnte.", "Kein Spieler vorhanden!", JOptionPane.ERROR_MESSAGE);
		}

	}
		
	void addArmy(){
		if (jcbPlayer.getItemCount() > 0){
			if (jtxtArmyAdd.getText().length() >0 ){
				Integer x;
				Integer i;
				x = jcbPlayer.getSelectedIndex();
				jcbPlayerArmyList.removeAllItems();
				jcbPlayerArmyList2.removeAllItems();
				alPlayer.get(x).addArmy(jtxtArmyAdd.getText());
				Object ai[] = alPlayer.get(x).alArmy.toArray();
	            for (i = 0; i < ai.length; i++){
	                jcbPlayerArmyList.addItem(ai[i]);
					jcbPlayerArmyList2.addItem(ai[i]);
	            }
	            jtxtArmyAdd.setText("");
			}
			else {
				JOptionPane.showMessageDialog(null, "Es konnte keine Armee angelegt werden da Sie keinen Armeenamen angegeben haben.", "Kein Armeename eingegeben!", JOptionPane.ERROR_MESSAGE);
			}
		}
		else{
			JOptionPane.showMessageDialog(null, "Kein Spieler ausgewählt.", "Kein Spieler ausgewählt!", JOptionPane.ERROR_MESSAGE);
		}

		
	}
	
	void removeArmy(){
		if(jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer i;
				Integer x;
				Integer y;
				x = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(x).deleteOneArmy(alPlayer.get(x).alArmy.get(y));
				jcbPlayerArmyList.removeAllItems();
				jcbPlayerArmyList2.removeAllItems();
				Object ai[] = alPlayer.get(x).alArmy.toArray();
				if (ai.length > 0){
					for (i=0; i <ai.length; i++){
						jcbPlayerArmyList.addItem(ai[i]);
						jcbPlayerArmyList2.addItem(ai[i]);
					}
				}
			}else{
				JOptionPane.showMessageDialog(null, "Keine Armee ausgewählt.", "Keine Armee ausgewählt!", JOptionPane.ERROR_MESSAGE);
			}
		}else{
			JOptionPane.showMessageDialog(null, "Kein Spieler ausgewählt.", "Kein Spieler ausgewählt!", JOptionPane.ERROR_MESSAGE);
		}

	}
 

kneubi

Mitglied
Class: MainGUI ------Teil2
Java:
	void mergeArmy(){
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0) {
				if (jcbPlayerArmyList2.getItemCount() > 0){
					if (jcbPlayerArmyList.getSelectedIndex() != jcbPlayerArmyList2.getSelectedIndex()){
						Integer x;
						Integer y;
						Integer z;
						Integer i;
						Integer j;
						Integer k;
						Boolean bolFlyingOK1 = false;
						Boolean bolFlyingOK2 = false;
						Boolean bolMechanizedOK1 = true;
						Boolean bolMechanizedOK2 = true;
						x = jcbPlayer.getSelectedIndex();
						y = jcbPlayerArmyList.getSelectedIndex();
						z = jcbPlayerArmyList2.getSelectedIndex();
						Object ai[] = alPlayer.get(x).alArmy.get(z).alUnit.toArray();
						for (i = 0; i < ai.length; i++){
							alPlayer.get(x).alArmy.get(y).alUnit.add((Unit) ai[i]);
						}
			            if (alPlayer.get(x).alArmy.get(y).getBolFlying() == false){
			            	alPlayer.get(x).alArmy.get(y).setBolFlying(false);
			            }if(alPlayer.get(x).alArmy.get(y).getBolFlying() == true){
			            	if(alPlayer.get(x).alArmy.get(z).getBolFlying() == false){
			            		alPlayer.get(x).alArmy.get(y).setBolFlying(false);
			            	}if(alPlayer.get(x).alArmy.get(z).getBolFlying() == true){
			            		alPlayer.get(x).alArmy.get(y).setBolFlying(true);
			            	}
			            }
			            if (alPlayer.get(x).alArmy.get(y).getBolMechanized() == false){
		            		alPlayer.get(x).alArmy.get(y).setBolMechanized(false);
			            }if(alPlayer.get(x).alArmy.get(y).getBolMechanized() == true){
			            	if(alPlayer.get(x).alArmy.get(z).getBolMechanized() == false){
			            		alPlayer.get(x).alArmy.get(y).setBolMechanized(false);
			            	}if(alPlayer.get(x).alArmy.get(z).getBolMechanized() == true){
			            		alPlayer.get(x).alArmy.get(y).setBolMechanized(true);
		            		}
			            }
			            if (alPlayer.get(x).alArmy.get(z).getBolTired() == true){
			            	alPlayer.get(x).alArmy.get(y).setBolTired(true);
			            }
			            if (alPlayer.get(x).alArmy.get(z).getBolFortified() == true){
			            	alPlayer.get(x).alArmy.get(y).setBolFortified(true);
			            }
			            if (alPlayer.get(x).alArmy.get(z).getBolVigliant() == true){
			            	alPlayer.get(x).alArmy.get(y).setBolVigliant(true);
			            }
			            if (alPlayer.get(x).alArmy.get(z).getBolAntiScouting() == true){
			            	alPlayer.get(x).alArmy.get(y).setBolAntiScouting(true);
			            }
			            if (alPlayer.get(x).alArmy.get(z).getBolUnderArtilleryFire() == true){
			            	alPlayer.get(x).alArmy.get(y).setBolUnderArtilleryFire(true);
			            }
			            if (alPlayer.get(x).alArmy.get(y).getBolWithoutHQ() == false){
			            	if (alPlayer.get(x).alArmy.get(z).getBolWithoutHQ() == false){
			            		alPlayer.get(x).alArmy.get(y).setBolWithoutHQ(false);
			            	}if(alPlayer.get(x).alArmy.get(z).getBolWithoutHQ() == true)
			            		alPlayer.get(x).alArmy.get(y).setBolWithoutHQ(false);
			            }if (alPlayer.get(x).alArmy.get(y).getBolWithoutHQ() == true){
			            	if(alPlayer.get(x).alArmy.get(z).getBolWithoutHQ() == false){
			            		alPlayer.get(x).alArmy.get(y).setBolWithoutHQ(false);
			            	}if(alPlayer.get(x).alArmy.get(z).getBolWithoutHQ() == true){
			            		alPlayer.get(x).alArmy.get(y).setBolWithoutHQ(true);
			            	}
			            }

						alPlayer.get(x).deleteOneArmy(alPlayer.get(x).alArmy.get(z));
						jcbPlayerArmyList.removeAllItems();
						jcbPlayerArmyList2.removeAllItems();
						Object ai2[] = alPlayer.get(x).alArmy.toArray();
			            for (i = 0; i < ai2.length; i++){
			                jcbPlayerArmyList.addItem(ai2[i]);
							jcbPlayerArmyList2.addItem(ai2[i]);
			            }
					}else {
						JOptionPane.showMessageDialog(null, "Die Armee kann nicht mit sich selber zusammengelegt werden.", "Falsche Auswahl zum zusammenlegen!", JOptionPane.ERROR_MESSAGE);
					}
				}else{
					JOptionPane.showMessageDialog(null, "Es wurde keine zweite Armee ausgewählt.", "Keine zweite Armee angegeben!", JOptionPane.ERROR_MESSAGE);
				}
			}else{
				JOptionPane.showMessageDialog(null, "Es wurde keine Armee angegeben.", "Keine Armee als Ziel angegeben!", JOptionPane.ERROR_MESSAGE);
			}
		}else{
			JOptionPane.showMessageDialog(null, "Kein Spieler ausgewählt.", "Kein Spieler ausgewählt!", JOptionPane.ERROR_MESSAGE);
		}
	}
	
	void addUnit(){
		if (jcbPlayer.getItemCount() > 0){
			if(jcbPlayerArmyList.getItemCount() > 0){
				intSelectedPlayer = jcbPlayer.getSelectedIndex();
				intSelectedArmy = jcbPlayerArmyList.getSelectedIndex();
				UnitAddGUI GUIUnitAddGUI = new UnitAddGUI(alPlayer.get(intSelectedPlayer).alArmy.get(intSelectedArmy) );
				GUIUnitAddGUI.setVisible(true);
			}
			else{
				JOptionPane.showMessageDialog(null, "Keine Armee ausgewählt.", "Keine Spieler ausgewählt!", JOptionPane.ERROR_MESSAGE);
			}
		}
		else{
			JOptionPane.showMessageDialog(null, "Kein Spieler ausgewählt.", "Kein Spieler ausgewählt!", JOptionPane.ERROR_MESSAGE);
		}

	}
	
	void changeJcbPlayer(){
		if (jcbPlayer.getItemCount() > 0){
			Integer i;
			Integer z;
			Integer y;
			z = jcbPlayer.getSelectedIndex();
			Object ai[] = alPlayer.get(z).alArmy.toArray();
			jcbPlayerArmyList.removeAllItems();
			jcbPlayerArmyList2.removeAllItems();
			if (ai.length >= 1){
				for (i = 0; i < ai.length; i++) {
					jcbPlayerArmyList.addItem(ai[i]);
					jcbPlayerArmyList2.addItem(ai[i]);
				}
			y = jcbPlayerArmyList.getSelectedIndex();
			jchbFlying.setSelected(alPlayer.get(z).alArmy.get(y).getBolFlying());
			jchbMechanized.setSelected(alPlayer.get(z).alArmy.get(y).getBolMechanized());
			jchbTired.setSelected(alPlayer.get(z).alArmy.get(y).getBolTired());
			jchbFortified.setSelected(alPlayer.get(z).alArmy.get(y).getBolFortified());
			jchbVigliant.setSelected(alPlayer.get(z).alArmy.get(y).getBolVigliant());
			jchbAntiScouting.setSelected(alPlayer.get(z).alArmy.get(y).getBolAntiScouting());
			jchbUnderArtilleryFire.setSelected(alPlayer.get(z).alArmy.get(y).getBolUnderArtilleryFire());
			jchbWithoutHQ.setSelected(alPlayer.get(z).alArmy.get(y).getBolWithoutHQ());
			}
		}
	}
	
	void changeJcbPlayerArmyList(){
		if (jcbPlayer.getItemCount() > 0) {
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				Integer i;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				Object ai[] = alPlayer.get(z).alArmy.get(y).alUnit.toArray();
				alListModel.get(0).removeAllElements();
				for (i = 0; i < ai.length; i++){
					alListModel.get(0).addElement(alPlayer.get(z).alArmy.get(y).alUnit.get(i).toStringAll());
				}
				jchbFlying.setSelected(alPlayer.get(z).alArmy.get(y).getBolFlying());
				jchbMechanized.setSelected(alPlayer.get(z).alArmy.get(y).getBolMechanized());
				jchbTired.setSelected(alPlayer.get(z).alArmy.get(y).getBolTired());
				jchbFortified.setSelected(alPlayer.get(z).alArmy.get(y).getBolFortified());
				jchbVigliant.setSelected(alPlayer.get(z).alArmy.get(y).getBolVigliant());
				jchbAntiScouting.setSelected(alPlayer.get(z).alArmy.get(y).getBolAntiScouting());
				jchbUnderArtilleryFire.setSelected(alPlayer.get(z).alArmy.get(y).getBolUnderArtilleryFire());
				jchbWithoutHQ.setSelected(alPlayer.get(z).alArmy.get(y).getBolWithoutHQ());
			}
		}
	}
	
	private void changeFlying() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolFlying(jchbFlying.isSelected());
			}
		}	
	}
	
	private void changeMechanized() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolMechanized(jchbMechanized.isSelected());
			}
		}	
	}
	
	private void changeTired() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolTired(jchbTired.isSelected());
			}
		}
	}
	
	private void changeFortified() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolFortified(jchbFortified.isSelected());
			}
		}	
	}
	
	private void changeVigliant() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolVigliant(jchbVigliant.isSelected());
			}
		}	
	}
	
	private void changeAntiScounting() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolAntiScouting(jchbAntiScouting.isSelected());
			}
		}
	}
	
	private void changeUnderArtilleryFire() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolUnderArtilleryFire(jchbUnderArtilleryFire.isSelected());
			}
		}
	}
	
	private void changeWithoutHQ() {
		if (jcbPlayer.getItemCount() > 0){
			if (jcbPlayerArmyList.getItemCount() > 0){
				Integer z;
				Integer y;
				z = jcbPlayer.getSelectedIndex();
				y = jcbPlayerArmyList.getSelectedIndex();
				alPlayer.get(z).alArmy.get(y).setBolWithoutHQ(jchbWithoutHQ.isSelected());
			}
		}
	}
}

Class: UnitAddGUI
Java:
package GUI;
import java.awt.AlphaComposite;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;

import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;

import Daten.Army;
import Daten.Unit;
import GUI.MainGUI;
import Daten.MyTableModel;

public class UnitAddGUI extends javax.swing.JFrame  implements ActionListener{

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JScrollPane jspUnitList;
	private JTextField jtxtEinheitName;
	private JButton jcmdUnitRemove;
	private JButton jcmdUnitEquiptmentAdd;
	private JButton jcmdUnitAdd;
	private JTextField jtxtPoints;
	private JLabel jlblPoints;
	private JCheckBox jcbMechanized;
	private JCheckBox jcbFlying;
	private JTable jtblUnitList;
	private JLabel jlblUnitName;
	private JComboBox jcbUnitSlot;
	public Integer intSelectedArmyFromGUI;
	public Integer intSelectedPlayerFromGUI;
	public ArrayList<Army> alArmyUnitAdd = new ArrayList<Army>();
	public ArrayList<MyTableModel> alUnitAddTableModel = new ArrayList<MyTableModel>();

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				UnitAddGUI inst = new UnitAddGUI();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public UnitAddGUI() {
		super();
		initGUI();
	}
	
	public UnitAddGUI(Army alArmy) {
		super();
		alArmyUnitAdd.add(alArmy);
		System.out.println(alArmyUnitAdd.toArray().length);
		System.out.println(alArmy);
		initGUI();

	}
	
	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jspUnitList = new JScrollPane();
				{
					MyTableModel UnitAddTableModel = 
							new MyTableModel(alArmyUnitAdd.get(0).alUnit);
					alUnitAddTableModel.add(UnitAddTableModel);
					jtblUnitList = new JTable();
					jspUnitList.setViewportView(jtblUnitList);
					jtblUnitList.setModel(UnitAddTableModel);
					jtblUnitList.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
					jtblUnitList.getColumn("Slot").setPreferredWidth(60);
					jtblUnitList.getColumn("Unitname").setPreferredWidth(407);
					jtblUnitList.getColumn("Points").setPreferredWidth(80);
					jtblUnitList.getColumn("Flying").setPreferredWidth(50);
					jtblUnitList.getColumn("Mechanized").setPreferredWidth(80);					
				}
			}
			{
				jcbFlying = new JCheckBox();
				jcbFlying.setText("Flying");
			}
			{
				jcbMechanized = new JCheckBox();
				jcbMechanized.setText("Mechanized");
			}
			{
				ComboBoxModel jcbUnitSlotModel = 
						new DefaultComboBoxModel(
								new String[] { "HQ", "Standard", "Elite", "Support","Sturm" });
				jcbUnitSlot = new JComboBox();
				jcbUnitSlot.setModel(jcbUnitSlotModel);
			}
			{
				jlblUnitName = new JLabel();
				jlblUnitName.setText("Unitname:");
			}
			{
				jtxtEinheitName = new JTextField();
			}
			{
				jcmdUnitAdd = new JButton();
				jcmdUnitAdd.setText("Add Unit");
				jcmdUnitAdd.addActionListener(this);
			}
			{
				jcmdUnitEquiptmentAdd = new JButton();
				jcmdUnitEquiptmentAdd.setText("Add Equiptment");
				jcmdUnitEquiptmentAdd.addActionListener(this);
			}
			{
				jcmdUnitRemove = new JButton();
				jcmdUnitRemove.setText("Remove Unit");
				jcmdUnitRemove.addActionListener(this);
			}
			{
				jlblPoints = new JLabel();
				jlblPoints.setText("Points:");
			}
			{
				jtxtPoints = new JTextField();
			}
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
				.addGap(7)
				.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(jcbUnitSlot, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jlblUnitName, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jtxtEinheitName, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jlblPoints, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jtxtPoints, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(jcmdUnitAdd, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jcbFlying, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jcbMechanized, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				.addComponent(jspUnitList, GroupLayout.PREFERRED_SIZE, 325, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(jcmdUnitEquiptmentAdd, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jcmdUnitRemove, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addGap(6));
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(thisLayout.createParallelGroup()
				    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				        .addGroup(thisLayout.createParallelGroup()
				            .addGroup(thisLayout.createSequentialGroup()
				                .addGroup(thisLayout.createParallelGroup()
				                    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                        .addComponent(jcbUnitSlot, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE)
				                        .addGap(25)
				                        .addComponent(jlblUnitName, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
				                        .addGap(0, 0, Short.MAX_VALUE))
				                    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                        .addGap(0, 0, Short.MAX_VALUE)
				                        .addComponent(jcbFlying, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE)
				                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				                        .addComponent(jcbMechanized, GroupLayout.PREFERRED_SIZE, 105, GroupLayout.PREFERRED_SIZE)
				                        .addGap(18)))
				                .addGap(12)
				                .addGroup(thisLayout.createParallelGroup()
				                    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                        .addComponent(jcmdUnitAdd, GroupLayout.PREFERRED_SIZE, 98, GroupLayout.PREFERRED_SIZE)
				                        .addGap(189))
				                    .addComponent(jtxtEinheitName, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 287, GroupLayout.PREFERRED_SIZE)))
				            .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                .addComponent(jcmdUnitEquiptmentAdd, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE)
				                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				                .addComponent(jcmdUnitRemove, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
				                .addGap(209)))
				        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				        .addComponent(jlblPoints, GroupLayout.PREFERRED_SIZE, 47, GroupLayout.PREFERRED_SIZE)
				        .addComponent(jtxtPoints, GroupLayout.PREFERRED_SIZE, 95, GroupLayout.PREFERRED_SIZE))
				    .addComponent(jspUnitList, GroupLayout.Alignment.LEADING, 0, 677, Short.MAX_VALUE))
				.addContainerGap());
			pack();
			this.setSize(701, 457);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void actionPerformed(ActionEvent e){
		if (e.getSource() == jcmdUnitAdd) {
			addUnit();
		}if (e.getSource() == jcmdUnitEquiptmentAdd) {
			addUnitEquiptment();
		}if (e.getSource() == jcmdUnitRemove) {
			removeUnit();
		}
	}
	
	void addUnit(){
		String strNewUnitName = jtxtEinheitName.getText();
		String strNewUnitSlot = jcbUnitSlot.getSelectedItem().toString();
		Integer intNewUnitCosts = Integer.parseInt(jtxtPoints.getText());
		Unit objUnit = new Unit(strNewUnitName, strNewUnitSlot, intNewUnitCosts, jcbFlying.isSelected(), jcbMechanized.isSelected());
		System.out.println(alArmyUnitAdd.toArray().length);
		alArmyUnitAdd.get(0).alUnit.add(objUnit);
		alUnitAddTableModel.get(0).fireTableDataChanged();
	}
	
	void addUnitEquiptment(){
		//Unit objUnit = new Unit(jtxtEinheitName.getText(), Integer.parseInt(jtxtPoints.getText()), jcbUnitSlot.getSelectedItem());
		//alArmyUnitAdd.get(0).alUnit.add(objUnit);
		//System.out.println(objUnit);
	}
	
	void removeUnit(){
		alArmyUnitAdd.get(0).alUnit.remove(jtblUnitList.getSelectedRow());
		alUnitAddTableModel.get(0).fireTableDataChanged();
	}
	

}

Class: UnitEquipmentAddGUI
Java:
package GUI;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;



public class UnitEquipmentAddGUI extends javax.swing.JFrame {
	private JTextField jtxtUnitName;
	private JButton jcmdEquipmentRemove;
	private JButton jcmdEquipmentAdd;
	private JLabel jlblUnitName;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				UnitEquipmentAddGUI inst = new UnitEquipmentAddGUI();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public UnitEquipmentAddGUI() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jtxtUnitName = new JTextField();
			}
			{
				jlblUnitName = new JLabel();
				jlblUnitName.setText("Equipmentname:");
			}
			{
				jcmdEquipmentAdd = new JButton();
				jcmdEquipmentAdd.setText("Add Equipment");
			}
			{
				jcmdEquipmentRemove = new JButton();
				jcmdEquipmentRemove.setText("Remove Equipment");
			}
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(thisLayout.createParallelGroup()
				    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				        .addComponent(jlblUnitName, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE)
				        .addComponent(jtxtUnitName, GroupLayout.PREFERRED_SIZE, 249, GroupLayout.PREFERRED_SIZE)
				        .addGap(0, 0, Short.MAX_VALUE))
				    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				        .addComponent(jcmdEquipmentAdd, GroupLayout.PREFERRED_SIZE, 124, GroupLayout.PREFERRED_SIZE)
				        .addGap(11)
				        .addComponent(jcmdEquipmentRemove, GroupLayout.PREFERRED_SIZE, 133, GroupLayout.PREFERRED_SIZE)
				        .addGap(0, 89, GroupLayout.PREFERRED_SIZE)))
				.addContainerGap(158, 158));
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(jtxtUnitName, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jlblUnitName, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(jcmdEquipmentAdd, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(jcmdEquipmentRemove, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addContainerGap(251, Short.MAX_VALUE));
			pack();
			this.setSize(527, 363);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
 

bERt0r

Top Contributor
Dann solltest du den Konstruktor deines TableModels:
Java:
public MyTableModel() {
 
    }
in den hier ändern:
Java:
public MyTableModel() {
 this.data=new ArrayList<Unit>();
    }
 

kneubi

Mitglied
Vielen Dank für die Rasche antwort, da hab ich wohl den Wald vor lauter bäumen nicht gesehen....

Nun gibt es aber das nächste Problem... es aktualisiert mir die Tabelle nicht, obwohl ich per klick auf einen Button folgenden code aufrufe:

Java:
alMainGUITableModel.get(0).fireTableDataChanged();

Bei der jTabel in dem UnitAddGUI wird mit dem Konstruktor direkt die alUnit-Arraylist referenziert. Dies wird nun allerdings bei dem MainGUI nicht da ich eine Leere Arraylist in die List "data" übergebe.

Hat jemand eine Idee wie ich die referenz nachträglich nach dem GUI aufbau machen könnte ohne dass es mir das jedesmal bei einem "button-klick"-event eine neue referenz erstellt?

Hm... If-Abfrage mit einem Boolean wert und beim ersten mal den wert von False auf True setzen? Gibt es einen "schöneren" Weg?

Also sprich sowas:
Java:
Public Class MainGUI(){
public Boolean bolReferenz = false;
...JavaCode....

...Button-klickevent....
if(bolReferenz = false){
...Rufe eine setMethode auf die die alUnit-ArrayList referenziert
}
...JavaCode...

Problem ist halt dass es die ArrayList "alUnit" die ich eigentlich übergeben müsste am anfang nicht gibt beim GUI aufbau, die wird erst noch instanziert während man Spieler, Armeen und Einheiten hinzufügt..
 

Harry Kane

Top Contributor
Scheint mit der 2. Wald zu sein....
ich habe mir deine 1500 Zeile Code zwar nicht durchgelesen (ich sehe auch keine Notwendigkeit das zu tun, da es mit deinem problem nix zu tun hat), aber ich glaube, dur brauchts nur eine einfache setData(List<Unit> data) in deinem TableModel.
In der Methode unbedingt fireTableDataChanged aufrufen, um anzuzeigen, dass sich der Inhalt des models geändert hat!
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
N Swing Print JTable mit AbstractTableModel AWT, Swing, JavaFX & SWT 1
N JTable, AbstractTableModel aus Datenbank initialisieren AWT, Swing, JavaFX & SWT 8
I JTable,AbstractTableModel Problem AWT, Swing, JavaFX & SWT 3
I JTable und AbstractTableModel AWT, Swing, JavaFX & SWT 10
H JTable - DefaultTableModel vs AbstractTableModel AWT, Swing, JavaFX & SWT 5
Ollek Swing JTable - Zeile löschen mit AbstractTableModel AWT, Swing, JavaFX & SWT 20
K JTable & AbstractTableModel AWT, Swing, JavaFX & SWT 9
G JTable (AbstractTableModel) wird nicht aktualisiert AWT, Swing, JavaFX & SWT 2
D JTable, DefaultTableCellRenderer & AbstractTableModel AWT, Swing, JavaFX & SWT 11
N JTable repaint mit AbstractTableModel AWT, Swing, JavaFX & SWT 2
I Swing JTable zeichnet kein vertical Grid AWT, Swing, JavaFX & SWT 6
J Drag und drop aus einer JTable - bitte um Unterstützung AWT, Swing, JavaFX & SWT 2
S HPRO und UPRO gemeinsame JTABLE gemeinsamer RENDERER ? AWT, Swing, JavaFX & SWT 1
F Swing JTable - MultiHeader inkl. Eingabemöglichkeit AWT, Swing, JavaFX & SWT 1
S JTable - Feldinhalte anzeigen AWT, Swing, JavaFX & SWT 15
D Swing JTable Spaltenbreite AWT, Swing, JavaFX & SWT 1
W Gibt es einen "automatischen Listener" in Swing oder JTable oder der ATM-Klasse? AWT, Swing, JavaFX & SWT 14
G jTable - getSelectedRow() AWT, Swing, JavaFX & SWT 3
I JTable mit einem Button zu einer Detail Seite springen AWT, Swing, JavaFX & SWT 4
P JTable Listener für die Änderung einzelner Zellen oder Rows AWT, Swing, JavaFX & SWT 2
D Tastaturabfragen CTRL+t, CTRL+E bei eine JTable, bestehend aus JTextAteas AWT, Swing, JavaFX & SWT 4
P Checkboxes in JTable nicht editable AWT, Swing, JavaFX & SWT 9
F Best-Practise: JTable Text in Zelle zu groß AWT, Swing, JavaFX & SWT 2
izoards JTable in CSV File schreiben... AWT, Swing, JavaFX & SWT 23
Kohl Jedes Objekt einer JTable um ein Zeichen verkürzen AWT, Swing, JavaFX & SWT 7
I JTable, DefaultTableModel, zwei Zahlen multiplizieren. AWT, Swing, JavaFX & SWT 26
M JTABLE / wie oft wurde gewürfelt. AWT, Swing, JavaFX & SWT 1
F JTable vergrößern AWT, Swing, JavaFX & SWT 2
H JTable: Diverse NullPointer-Exceptions zur Laufzeit AWT, Swing, JavaFX & SWT 3
J Swing Werte des JTable werden nicht angezeigt AWT, Swing, JavaFX & SWT 9
T Swing JTable cellRenderer mit jpg Hintergrundfarbe lässt sich nicht ändern. AWT, Swing, JavaFX & SWT 1
HoT Einzelne Zelle in JTable Rahmen unten setzen AWT, Swing, JavaFX & SWT 24
B JTable Zellen zusammenfügen AWT, Swing, JavaFX & SWT 3
M Swing Cell Renderer für Zeilenumbruch in JTable AWT, Swing, JavaFX & SWT 0
H JTable im JSplitPane darstellen AWT, Swing, JavaFX & SWT 2
MadMax2506 Swing JTable lädt sehr lange AWT, Swing, JavaFX & SWT 1
D Zeilenumbruch in einer JTable AWT, Swing, JavaFX & SWT 9
R Swing JTable und Spaltenausrichtung AWT, Swing, JavaFX & SWT 8
G JTable füllen AWT, Swing, JavaFX & SWT 1
H JTable TableCellEditor-Problem AWT, Swing, JavaFX & SWT 0
W Swing JTable Zeilenumbruch innerhalb einer Zelle AWT, Swing, JavaFX & SWT 3
J Datensatz in jTable ausgeben AWT, Swing, JavaFX & SWT 3
M Swing Automatischer Editorstart in JTable-Zelle AWT, Swing, JavaFX & SWT 5
ralfb1105 Swing JTable aktualisieren AWT, Swing, JavaFX & SWT 5
adiko01 JTable: Nur markierte Zeilen aus der Tabelle in CSV exportiern AWT, Swing, JavaFX & SWT 9
M JTable.setDefaultRenderer(...) greift nicht AWT, Swing, JavaFX & SWT 0
J JTable: Eingabe in Tabellenzelle korrigieren AWT, Swing, JavaFX & SWT 4
T Problem mit JTable Sortierung AWT, Swing, JavaFX & SWT 2
D JTable nach INSERT aktualisieren /refreshen AWT, Swing, JavaFX & SWT 1
D MySQL Daten in JTable anzeigen AWT, Swing, JavaFX & SWT 2
H Swing Jtable extra spalte AWT, Swing, JavaFX & SWT 6
S Swing Rechteck über JTable zeichnen (per MouseListener) AWT, Swing, JavaFX & SWT 1
S Swing Mal wieder JTable Ansicht aktualisieren AWT, Swing, JavaFX & SWT 10
A JTable mit Daten füllen AWT, Swing, JavaFX & SWT 1
VfL_Freak Swing Einzelne Zeile in jTable selektieren klappt nicht AWT, Swing, JavaFX & SWT 7
N AWT jTable CellRenderer AWT, Swing, JavaFX & SWT 6
T Swing JTable valueChanged datensatz löschen AWT, Swing, JavaFX & SWT 1
0 Swing JTable aus anderer Klasse updaten AWT, Swing, JavaFX & SWT 5
S Jtable defaultRenderer wohin damit ? AWT, Swing, JavaFX & SWT 23
T Swing JTable / FocusListener AWT, Swing, JavaFX & SWT 0
it_is_all Warum wird die JTable im JDialog nicht angezeigt? AWT, Swing, JavaFX & SWT 1
L Swing JTable im Panel darstellen AWT, Swing, JavaFX & SWT 8
T Swing Double Click bei Buttons in JTable AWT, Swing, JavaFX & SWT 9
J addRow bei JTable AWT, Swing, JavaFX & SWT 6
M Jtable gibt -1 wert bei selectedRow und Column AWT, Swing, JavaFX & SWT 3
Meeresgott Swing JTable AWT, Swing, JavaFX & SWT 4
J JTable Selection Listener funktioniert nicht AWT, Swing, JavaFX & SWT 4
C Swing Daten in JTable wiedergeben per TableModel und MVC Pattern AWT, Swing, JavaFX & SWT 16
Z Swing Drag&Drop zwischen JTable und JTree AWT, Swing, JavaFX & SWT 4
Thallius JTable dynamisch Spaltenanzahl verändern AWT, Swing, JavaFX & SWT 2
Thallius JTable dynamisch laden? AWT, Swing, JavaFX & SWT 2
B Swing JTable sortieren AWT, Swing, JavaFX & SWT 2
T Swing JTable auslesen und befüllen AWT, Swing, JavaFX & SWT 8
B JTable wird nicht angezeigt AWT, Swing, JavaFX & SWT 1
J JTable und Suchlogik AWT, Swing, JavaFX & SWT 4
Viktim Swing JTable mit Tab verlassen AWT, Swing, JavaFX & SWT 1
F Swing Spaltenbreite einer Column eines JTable auslesen AWT, Swing, JavaFX & SWT 5
Viktim Swing JTable Mit Tab druch Zeilen Wechseln AWT, Swing, JavaFX & SWT 5
Thallius Warum refrehsed mein JTable nicht? AWT, Swing, JavaFX & SWT 5
Ghostman1711 Hinzufügen ausgewählter Dateinen des Filechoosers zu einem JTable AWT, Swing, JavaFX & SWT 9
S Swing JTable - Einzelne Rows einfärben AWT, Swing, JavaFX & SWT 11
M Wert einer Zelle aus JTable ziehen AWT, Swing, JavaFX & SWT 4
K JTable getValueAt() klappt nicht immer AWT, Swing, JavaFX & SWT 1
K JTable in extra Klasse, Zugriff in einer anderen klasse nicht möglich AWT, Swing, JavaFX & SWT 26
B Swing Tabelle(JTable) filtern swing GUI AWT, Swing, JavaFX & SWT 3
P JTable - bei Eingabe Selektion AWT, Swing, JavaFX & SWT 0
P Fokus auf Zelle in JTable AWT, Swing, JavaFX & SWT 1
S Swing Deselektion in JTable verhindern AWT, Swing, JavaFX & SWT 0
D Problem mit JTable AWT, Swing, JavaFX & SWT 1
Ananaskirsche Swing jTable Reihen zuviel eingefügt AWT, Swing, JavaFX & SWT 12
P im JTable die Schriftfarbe ändern AWT, Swing, JavaFX & SWT 19
T Swing JTable wird nicht angezeigt AWT, Swing, JavaFX & SWT 4
S Dreiecke in bestimmte Zellen einer JTable AWT, Swing, JavaFX & SWT 9
LexeB4F Zelle in JTable gezielt einfärben AWT, Swing, JavaFX & SWT 4
LexeB4F JTable mehrere Zelle selektieren und inhalte Löschen.. Ideen gesucht AWT, Swing, JavaFX & SWT 1
D Swing JTable Renderer Grafikfehler AWT, Swing, JavaFX & SWT 0
K Swing JTable mit ImageIcon und Text in einer Zelle AWT, Swing, JavaFX & SWT 1
M Swing JTable GroupableHeader Background Color AWT, Swing, JavaFX & SWT 4
K Swing JTable updaten AWT, Swing, JavaFX & SWT 9
thet1983 Swing MySQL >> JTable AWT, Swing, JavaFX & SWT 5

Ähnliche Java Themen


Oben