Problem mit meiner GUI/GridbagLayout

edfred

Mitglied
Hallo zusammen,

ich habe das erste Mal mit dem GridbagLayout herum expermentiert und es funktioniert leider nicht so wie ich es gerne hätte.
Meine ganzen Labels und Textfelder, die in einem mainPanel liegen erscheinen nicht sofort, sondern erst wenn ich das Frame verklineere oder vergrößere. :autsch:
Ich habe vor ein Adressbuch zu erstellen, aber nur zu Übungszwecken, da ich in der Swing-Programmierung noch ziemlich grün hinter den Ohren bin.

Ich bin für jeden Hinweis und Verbesserungstipp sehr Dankbar.

Das ist mein Code für die GUI:

Java:
package de.home.addressbook.gui;

import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;


import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;

import de.home.addressbook.actions.CloseButtonActionListenerImpl;
import de.home.addressbook.entry.AddressbookEntry;
import de.home.addressbook.utils.Constants;

public class AddressbookGUI implements ActionListener{

	/**
	 * Autogenerated serial version ID
	 */
	private static final long 			serialVersionUID = -4103836616194940083L;
	
	private JTextField 					givennameField, secondGivennameField, surenameField, birthdayField, 
										streetField, houseNumberField, placeField, zipField,
										emailField, phoneField, mobileField;
	
	private JLabel 	   					givennameLabel, secondGivennameLabel, surenameLabel, birthdayLabel, 
										streetLabel, houseNumberLabel, placeLabel, zipLabel,
										emailLabel, phoneLabel, mobileLabel, pictureLabel;
	
	private JList 	   					listOfEntries;
	
	private JPanel	   					picturePanel;
	
	private JPanel						mainContentPanel;
	
	private JScrollPane 				listScrollPane;
		
	private JMenuBar 					myMenuBar;
	
	private JMenu 						file;
	
	private JMenuItem 					newPerson, close, savetoDatabase, saveToFile;
	
	private ImageIcon 					profilePicture;
	
	private AddressbookEntry 			entry;
	
	private ArrayList<String> 			listData;
	
	private JFrame 						frame;

	
	public AddressbookGUI() {
		this.entry  = new AddressbookEntry();
		this.frame 		= new JFrame(Constants.FRAME_TITLE_DE);
		this.listData 	= new ArrayList<String>();
	}
	
	
	public void createView() {
		
		initFrame();
				
		initLabelsAndFields();

		initContent();
	}
	
	private void initContent() {
		
		GridBagLayout gbl = new GridBagLayout();
		GridBagConstraints constraintsPictureL = new GridBagConstraints();
		GridBagConstraints constraintsPictureP = new GridBagConstraints();
		GridBagConstraints constraintsGivennameL = new GridBagConstraints();
		GridBagConstraints constraintsGivennameF = new GridBagConstraints();
		GridBagConstraints constraints2ndGivennameL = new GridBagConstraints();
		GridBagConstraints constraints2ndGivennameF = new GridBagConstraints();
		GridBagConstraints constraintsSurenameL = new GridBagConstraints();
		GridBagConstraints constraintsSurenameF = new GridBagConstraints();
		GridBagConstraints constraintsBirthdayL = new GridBagConstraints();
		GridBagConstraints constraintsBirthdayF = new GridBagConstraints();
		GridBagConstraints constraintsStreetL = new GridBagConstraints();
		GridBagConstraints constraintsStreetF = new GridBagConstraints();
		GridBagConstraints constraintsHouseNoL = new GridBagConstraints();
		GridBagConstraints constraintsHouseNoF = new GridBagConstraints();
		GridBagConstraints constraintsPlaceL = new GridBagConstraints();
		GridBagConstraints constraintsPlaceF = new GridBagConstraints();
		GridBagConstraints constraintsZipL = new GridBagConstraints();
		GridBagConstraints constraintsZipF = new GridBagConstraints();
		GridBagConstraints constraintsEmailL = new GridBagConstraints();
		GridBagConstraints constraintsEmailF = new GridBagConstraints();
		GridBagConstraints constraintsPhoneL = new GridBagConstraints();
		GridBagConstraints constraintsPhoneF = new GridBagConstraints();
		GridBagConstraints constraintsMobileL = new GridBagConstraints();
		GridBagConstraints constraintsMobileF = new GridBagConstraints();
		
		mainContentPanel = new JPanel();
		mainContentPanel.setLayout(gbl);
		picturePanel = new JPanel();
		
		/*
		 * If no entries available, no information should be available. 
		 * mainContentPanel can be set to not enabled.
		 */
//		if(listData.size() != 0 || listData == null) {
			int countY = 0;
			int none = GridBagConstraints.NONE;
			int horizontal = GridBagConstraints.HORIZONTAL;
			
			constraintsPictureL.fill = horizontal;
			constraintsPictureL.gridx = 0;
			constraintsPictureL.gridy = countY;
			constraintsPictureL.insets = new Insets(2, 5, 25, 50); // top left bot right
			constraintsPictureL.anchor = GridBagConstraints.CENTER;
			mainContentPanel.add(pictureLabel, constraintsPictureL);
			
			constraintsPictureP.fill = horizontal;
			constraintsPictureP.gridx = 1;
			constraintsPictureP.gridy = ++countY;
			constraintsPictureP.anchor = GridBagConstraints.CENTER;
			constraintsPictureP.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(picturePanel, constraintsPictureP);
			
			constraintsGivennameL.fill = horizontal;
			constraintsGivennameL.gridx = 0;
			constraintsGivennameL.gridy = ++countY;
			constraintsGivennameL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsGivennameL.weightx = 1.5;
			constraintsGivennameL.gridwidth = 2;
			constraintsGivennameL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(givennameLabel,constraintsGivennameL);
			
			constraintsGivennameF.fill = horizontal;
			constraintsGivennameF.gridx = 1;
			constraintsGivennameF.gridy = countY;
			constraintsGivennameF.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(givennameField, constraintsGivennameF);
			
			constraints2ndGivennameL.fill = none;
			constraints2ndGivennameL.gridx = 0;
			constraints2ndGivennameL.gridy = ++countY;
			constraints2ndGivennameL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraints2ndGivennameL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(secondGivennameLabel,constraints2ndGivennameL);
			
			constraints2ndGivennameF.fill = horizontal;
			constraints2ndGivennameF.gridx = 1;
			constraints2ndGivennameF.gridy = countY;
			constraints2ndGivennameF.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(secondGivennameField, constraints2ndGivennameF);
			
			constraintsSurenameL.fill = none;
			constraintsSurenameL.gridx = 0;
			constraintsSurenameL.gridy = ++countY;
			constraintsSurenameL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsSurenameL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(surenameLabel, constraintsSurenameL);
			
			constraintsSurenameF.fill = horizontal;
			constraintsSurenameF.gridx = 1;
			constraintsSurenameF.gridy = countY;
			constraintsSurenameF.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(surenameField, constraintsSurenameF);
			
			constraintsBirthdayL.fill = none;
			constraintsBirthdayL.gridx = 0;
			constraintsBirthdayL.gridy = ++countY;
			constraintsBirthdayL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsBirthdayL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(birthdayLabel, constraintsBirthdayL);
			
			constraintsBirthdayF.fill = horizontal;
			constraintsBirthdayF.gridx = 1;
			constraintsBirthdayF.gridy = countY;
			constraintsBirthdayF.insets = new Insets(2, 5, 2, 125);
			mainContentPanel.add(birthdayField, constraintsBirthdayF);
			
			constraintsStreetL.fill = none;
			constraintsStreetL.gridx = 0;
			constraintsStreetL.gridy = ++countY;
			constraintsStreetL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsStreetL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(streetLabel, constraintsStreetL);
			
			constraintsStreetF.fill = horizontal;
			constraintsStreetF.gridx = 1;
			constraintsStreetF.gridy = countY;
			constraintsStreetF.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(streetField, constraintsStreetF);
	
			constraintsHouseNoL.fill = none;
			constraintsHouseNoL.gridx = 0;
			constraintsHouseNoL.gridy = ++countY;
			constraintsHouseNoL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsHouseNoL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(houseNumberLabel, constraintsHouseNoL);
			
			constraintsHouseNoF.fill = horizontal;
			constraintsHouseNoF.gridx = 1;
			constraintsHouseNoF.gridy = countY;
			constraintsHouseNoF.insets = new Insets(2, 5, 2, 150);
			mainContentPanel.add(houseNumberField, constraintsHouseNoF);
			
			constraintsZipL.fill = none;
			constraintsZipL.gridx = 0;
			constraintsZipL.gridy = ++countY;
			constraintsZipL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsZipL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(zipLabel, constraintsZipL);
			
			constraintsZipF.fill = horizontal;
			constraintsZipF.gridx = 1;
			constraintsZipF.gridy = countY;
			constraintsZipF.insets = new Insets(2, 5, 2, 150);
			mainContentPanel.add(zipField, constraintsZipF);
			
			constraintsPlaceL.fill = none;
			constraintsPlaceL.gridx = 0;
			constraintsPlaceL.gridy = ++countY;
			constraintsPlaceL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsPlaceL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(placeLabel, constraintsPlaceL);
			
			constraintsPlaceF.fill = horizontal;
			constraintsPlaceF.gridx = 1;
			constraintsPlaceF.gridy = countY;
			constraintsPlaceF.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(placeField, constraintsPlaceF);
			
			constraintsEmailL.fill = none;
			constraintsEmailL.gridx = 0;
			constraintsEmailL.gridy = ++countY;
			constraintsEmailL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsEmailL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(emailLabel, constraintsEmailL);
			
			constraintsEmailF.fill = horizontal;
			constraintsEmailF.gridx = 1;
			constraintsEmailF.gridy = countY;
			constraintsEmailF.insets = new Insets(5, 5, 5, 50);
			mainContentPanel.add(emailField, constraintsEmailF);
			
			constraintsPhoneL.fill = none;
			constraintsPhoneL.gridx = 0;
			constraintsPhoneL.gridy = ++countY;
			constraintsPhoneL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsPhoneL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(phoneLabel, constraintsPhoneL);
			
			constraintsPhoneF.fill = horizontal;
			constraintsPhoneF.gridx = 1;
			constraintsPhoneF.gridy = countY;
			constraintsPhoneF.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(phoneField, constraintsPhoneF);
			
			constraintsMobileL.fill = none;
			constraintsMobileL.gridx = 0;
			constraintsMobileL.gridy = ++countY;
			constraintsMobileL.anchor = GridBagConstraints.ABOVE_BASELINE_LEADING;
			constraintsMobileL.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(mobileLabel, constraintsMobileL);
			
			constraintsMobileF.fill = horizontal;
			constraintsMobileF.gridx = 1;
			constraintsMobileF.gridy = countY;
			constraintsMobileF.insets = new Insets(2, 5, 2, 50);
			mainContentPanel.add(mobileField, constraintsMobileF);
			
//		} else {	
//			mainContentPanel.setEnabled(false);
//		}
		
		listOfEntries = new JList(listData.toArray());
		listOfEntries.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		listOfEntries.setLayoutOrientation(JList.VERTICAL);
		listOfEntries.setSize(600, 800);
		listOfEntries.setFixedCellWidth(200);
		listOfEntries.setFixedCellHeight(30);
		
		listScrollPane = new JScrollPane(listOfEntries, 
				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, 
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		
		JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
								listScrollPane, mainContentPanel);
		split.setOneTouchExpandable(true);
		split.setDividerLocation(175);
		
		DefaultListModel listModel = new DefaultListModel(); 
		listModel.addElement(listData);

		frame.getContentPane().add(split);

	}
	
	private void initFrame() {
		/*
		 * Setting layout of the main frame 
		 */
		frame.getContentPane().setLayout(new BorderLayout());
		frame.setSize(Constants.FRAME_SIZE);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLocation( (Constants.SCREEN_SIZE.width - frame.getSize().width)/2, 
					 (Constants.SCREEN_SIZE.height - frame.getSize().height)/2);
		
		myMenuBar = new JMenuBar();
		myMenuBar.setBackground(Constants.GRAY);
		file = new JMenu(Constants.MENU_FILE_DE);
		file.setBackground(Constants.GRAY);
		
		newPerson = new JMenuItem(Constants.MENU_NEW_PERSON_DE);
		savetoDatabase = new JMenuItem(Constants.MENU_SAVE_TO_DB_DE);
		saveToFile = new JMenuItem(Constants.MENU_SAVE_TO_FILE_DE);
		close = new JMenuItem(Constants.MENU_CLOSE_DE);
		
		file.add(newPerson);
		file.add(savetoDatabase);
		file.add(saveToFile);
		file.add(close);
		
		newPerson.addActionListener(this);
//		savetoDatabase.addActionListener();
//		saveToFile.addActionListener();
		close.addActionListener(new CloseButtonActionListenerImpl(close));
		
		myMenuBar.add(file);
		
		frame.getContentPane().add(myMenuBar, BorderLayout.NORTH);
		
		frame.setVisible(Constants.FRAME_VISIBILITY);
		frame.validate();
		frame.repaint();
	}
	
	private void initLabelsAndFields() {
//		---------------------------------------------------
//		*					Init labels					  *
//		---------------------------------------------------
		
		givennameLabel = new JLabel(Constants.GIVENNAME_LABEL_DE);
		givennameLabel.setSize(Constants.LABEL_SIZE);
	
		secondGivennameLabel = new JLabel(Constants.SECOND_GIVENNAME_LABEL_DE);
		secondGivennameLabel.setSize(Constants.LABEL_SIZE);
		
		surenameLabel = new JLabel(Constants.SURENAME_LABEL_DE);
		surenameLabel.setSize(Constants.LABEL_SIZE);
		
		birthdayLabel = new JLabel(Constants.BIRTHDAY_LABEL_DE);
		birthdayLabel.setSize(Constants.LABEL_SIZE);
		
		streetLabel = new JLabel(Constants.STREET_LABEL_DE);
		streetLabel.setSize(Constants.LABEL_SIZE);
	
		houseNumberLabel = new JLabel(Constants.HOUSENUMBER_LABEL_DE);
		houseNumberLabel.setSize(Constants.LABEL_SIZE);
		
		placeLabel = new JLabel(Constants.PLACE_LABEL_DE);
		placeLabel.setSize(Constants.LABEL_SIZE);
		
		zipLabel = new JLabel(Constants.ZIP_LABEL_DE);
		zipLabel.setSize(Constants.LABEL_SIZE);
		
		emailLabel = new JLabel(Constants.EMAIL_LABEL_DE);
		emailLabel.setSize(Constants.LABEL_SIZE);
		
		phoneLabel = new JLabel(Constants.PHONE_LABEL_DE);
		phoneLabel.setSize(Constants.LABEL_SIZE);
		
		mobileLabel = new JLabel(Constants.MOBILE_LABEL_DE);
		mobileLabel.setSize(Constants.LABEL_SIZE);
		
		pictureLabel = new JLabel("Bild von: ");
		pictureLabel.setSize(Constants.LABEL_SIZE);
		
//		---------------------------------------------------
//		*					Init fields					  *
//		---------------------------------------------------
		
		int count = 0;
		givennameField = new JTextField(
				entry.getPerson().getGivenname() == null ? "" : entry.getPerson().getGivenname());
		givennameField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		secondGivennameField = new JTextField(
				entry.getPerson().getSecondGivenname() == null ? "" : entry.getPerson().getSecondGivenname());
		secondGivennameField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		surenameField = new JTextField(
				entry.getPerson().getSurename() == null ? "" : entry.getPerson().getSurename());
		surenameField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		birthdayField = new JTextField(
				entry.getPerson().getBirthday() == null ? "" : entry.getPerson().getBirthday().toString());
		birthdayField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		streetField = new JTextField(
				entry.getAddress().getStreet() == null ? "" : entry.getAddress().getStreet());
		streetField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		houseNumberField = new JTextField(
				entry.getAddress().getHousenumber() == null ? "" : entry.getAddress().getHousenumber());
		houseNumberField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		placeField = new JTextField(
				entry.getAddress().getPlace() == null ? "" : entry.getAddress().getPlace());
		placeField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		zipField = new JTextField(
				entry.getAddress().getZip() == 0 ? "" : String.valueOf(entry.getAddress().getZip()));
		zipField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		emailField = new JTextField(
				entry.getPerson().getEmail() == null ? "" : entry.getPerson().getEmail());
		emailField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		phoneField = new JTextField(
				entry.getPerson().getPhone() == null ? "" : entry.getPerson().getPhone());
		phoneField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		mobileField = new JTextField(
				entry.getPerson().getMobile() == null ? "" : entry.getPerson().getMobile());
		mobileField.setBackground(count%2==0 ? Constants.GRAY : Constants.WHITE);
		count += 1;
		
		
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource().equals(newPerson)) {
			new NewPersonEntryGUI(this, frame).initDialog();
		}
		
	}	
	
	/*
	 * For testing
	 */
	public static void main(String[] args) {
		new AddressbookGUI().createView();
	}
	
	// ---------------------------------------------------------------
	// *			 	Getter- and Setter methods					 *
	// ---------------------------------------------------------------

	
	/**
	 * @return the givennameField
	 */
	public JTextField getGivennameField() {
		return givennameField;
	}

	/**
	 * @return the secondGivennameField
	 */
	public JTextField getSecondGivennameField() {
		return secondGivennameField;
	}

	/**
	 * @return the surenameField
	 */
	public JTextField getSurenameField() {
		return surenameField;
	}

	/**
	 * @return the birthdayField
	 */
	public JTextField getBirthdayField() {
		return birthdayField;
	}

	/**
	 * @return the streetField
	 */
	public JTextField getStreetField() {
		return streetField;
	}

	/**
	 * @return the houseNumberField
	 */
	public JTextField getHouseNumberField() {
		return houseNumberField;
	}

	/**
	 * @return the placeField
	 */
	public JTextField getPlaceField() {
		return placeField;
	}

	/**
	 * @return the zipField
	 */
	public JTextField getZipField() {
		return zipField;
	}

	/**
	 * @return the emailField
	 */
	public JTextField getEmailField() {
		return emailField;
	}

	/**
	 * @return the phoneField
	 */
	public JTextField getPhoneField() {
		return phoneField;
	}

	/**
	 * @return the mobileField
	 */
	public JTextField getMobileField() {
		return mobileField;
	}

	/**
	 * @return the profilePicture
	 */
	public ImageIcon getProfilePicture() {
		return profilePicture;
	}

	/**
	 * @return the listData
	 */
	public ArrayList<String> getListData() {
		return listData;
	}

	/**
	 * @param givennameField the givennameField to set
	 */
	public void setGivennameField(JTextField givennameField) {
		this.givennameField = givennameField;
	}

	/**
	 * @param secondGivennameField the secondGivennameField to set
	 */
	public void setSecondGivennameField(JTextField secondGivennameField) {
		this.secondGivennameField = secondGivennameField;
	}

	/**
	 * @param surenameField the surenameField to set
	 */
	public void setSurenameField(JTextField surenameField) {
		this.surenameField = surenameField;
	}

	/**
	 * @param birthdayField the birthdayField to set
	 */
	public void setBirthdayField(JTextField birthdayField) {
		this.birthdayField = birthdayField;
	}

	/**
	 * @param streetField the streetField to set
	 */
	public void setStreetField(JTextField streetField) {
		this.streetField = streetField;
	}

	/**
	 * @param houseNumberField the houseNumberField to set
	 */
	public void setHouseNumberField(JTextField houseNumberField) {
		this.houseNumberField = houseNumberField;
	}

	/**
	 * @param placeField the placeField to set
	 */
	public void setPlaceField(JTextField placeField) {
		this.placeField = placeField;
	}

	/**
	 * @param zipField the zipField to set
	 */
	public void setZipField(JTextField zipField) {
		this.zipField = zipField;
	}

	/**
	 * @param emailField the emailField to set
	 */
	public void setEmailField(JTextField emailField) {
		this.emailField = emailField;
	}

	/**
	 * @param phoneField the phoneField to set
	 */
	public void setPhoneField(JTextField phoneField) {
		this.phoneField = phoneField;
	}

	/**
	 * @param mobileField the mobileField to set
	 */
	public void setMobileField(JTextField mobileField) {
		this.mobileField = mobileField;
	}

	/**
	 * @param profilePicture the profilePicture to set
	 */
	public void setProfilePicture(ImageIcon profilePicture) {
		this.profilePicture = profilePicture;
	}

	/**
	 * @param listData the listData to set
	 */
	public void setListData(ArrayList<String> listData) {
		this.listData = listData;
	}

	public void setEntry(AddressbookEntry entry) {
		this.entry = entry;
	}

	public AddressbookEntry getEntry() {
		return entry;
	}


	/**
	 * @return the frame
	 */
//	public JFrame getFrame() {
//		return frame;
//	}


	/**
	 * @param frame the frame to set
	 */
//	public void setFrame(JFrame frame) {
//		this.frame = frame;
//	}


	/**
	 * @return the mainContentPanel
	 */
	public JPanel getMainContentPanel() {
		return mainContentPanel;
	}


	/**
	 * @param mainContentPanel the mainContentPanel to set
	 */
	public void setMainContentPanel(JPanel mainContentPanel) {
		this.mainContentPanel = mainContentPanel;
	}
}

Vorab vielen Dank für eure Hilfe.

Viele Grüße
Edfred
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
L vermutlich Problem in meiner for-Schleife AWT, Swing, JavaFX & SWT 6
G Problem mit der Anzeige von jLabel. Unlesbar wenn der Text geändert wird. AWT, Swing, JavaFX & SWT 28
H 2D-Grafik Problem mit Paint AWT, Swing, JavaFX & SWT 1
S Layout - Problem AWT, Swing, JavaFX & SWT 1
Tassos JavaFX/Problem mit der Maussteuerung in Stackpane AWT, Swing, JavaFX & SWT 7
sserio Java Fx - Problem AWT, Swing, JavaFX & SWT 3
A Problem Spiel auf Panel der GUI zu bringen AWT, Swing, JavaFX & SWT 1
A JavaFX Controller Problem AWT, Swing, JavaFX & SWT 1
TheWhiteShadow JavaFX ListView Problem beim Entfernen von Elementen AWT, Swing, JavaFX & SWT 1
E LayoutManager Welcher Layout-Mix löst mein Problem? AWT, Swing, JavaFX & SWT 3
Umb3rus JavaFX Problem mit PropertyValueFactory: can not read from unreadable property AWT, Swing, JavaFX & SWT 1
T Problem mit paintComponent() AWT, Swing, JavaFX & SWT 17
AmsananKING Java Menü-Problem AWT, Swing, JavaFX & SWT 1
K JavaFX Resizing-Problem beim BorderLayout (Center Component) beim Arbeiten mit mehreren FXMLs AWT, Swing, JavaFX & SWT 2
G Instance OF Problem AWT, Swing, JavaFX & SWT 9
FrittenFritze Ein Problem mit der CSSBox, die Größe wird nicht angepasst AWT, Swing, JavaFX & SWT 5
M Problem mit dem Anzeigen von Frames im Vordergrund AWT, Swing, JavaFX & SWT 5
Badebay Problem mit JButton AWT, Swing, JavaFX & SWT 2
newJavaGeek Grid-Layout problem AWT, Swing, JavaFX & SWT 7
J JavaFX Löschen im Tabelview macht Problem AWT, Swing, JavaFX & SWT 15
JavaTalksToMe JavaFx ExekutorService Problem AWT, Swing, JavaFX & SWT 2
Zrebna Problem bei Eventhandling (Value soll nach jedem erneutem Klick gelöscht werden) AWT, Swing, JavaFX & SWT 4
B Problem mit JavaFX AWT, Swing, JavaFX & SWT 5
J css Problem AWT, Swing, JavaFX & SWT 5
B JavaFX habe mein Problem fett markiert AWT, Swing, JavaFX & SWT 2
A Swing Filter-Problem AWT, Swing, JavaFX & SWT 1
temi JavaFX Problem mit IntelliJ und JavaFx 11 unter XUbuntu AWT, Swing, JavaFX & SWT 3
L Java FX Problem mit Ubuntu 18 und JavaFx AWT, Swing, JavaFX & SWT 27
H JTable TableCellEditor-Problem AWT, Swing, JavaFX & SWT 0
kodela Swing Problem mit Warten-Dialog AWT, Swing, JavaFX & SWT 16
B JavaFx Scene Builder Problem AWT, Swing, JavaFX & SWT 2
B [Problem] Java öffnet Word-Datein nicht AWT, Swing, JavaFX & SWT 14
T DataBinding Problem AWT, Swing, JavaFX & SWT 5
Blender3D Problem mit € Symbol Font Gotham Windows 10 Swing AWT, Swing, JavaFX & SWT 11
T Problem mit JTable Sortierung AWT, Swing, JavaFX & SWT 2
J Problem mit Platfrom run later AWT, Swing, JavaFX & SWT 15
J Problem mit Platfrom run later AWT, Swing, JavaFX & SWT 0
D Swing SwingUtils / Thread Problem AWT, Swing, JavaFX & SWT 3
L JavaFX Problem beim Aufrufen einer Methode AWT, Swing, JavaFX & SWT 5
T Swing Problem mit Datum und FormattedTextField AWT, Swing, JavaFX & SWT 2
S AWT Java print dialog Problem AWT, Swing, JavaFX & SWT 0
olfibits JavaFX Problem mit HTMLEditor AWT, Swing, JavaFX & SWT 0
W SWT hover-background-problem with first column in TreeViewer AWT, Swing, JavaFX & SWT 0
M Problem mit Add JScrollPane AWT, Swing, JavaFX & SWT 25
Mario1409 Swing JTextArea scroll Problem AWT, Swing, JavaFX & SWT 0
N Swing Problem mit loop AWT, Swing, JavaFX & SWT 2
S Swing Problem mit Button und ActionListener AWT, Swing, JavaFX & SWT 5
S Swing & Clean und build Problem AWT, Swing, JavaFX & SWT 12
S JLabel setText() Problem AWT, Swing, JavaFX & SWT 6
I 2D-Grafik Problem beim Ändern der Farbe eine 2d Objekts AWT, Swing, JavaFX & SWT 3
G Swing Splitpane Problem AWT, Swing, JavaFX & SWT 1
F Problem mit der FXML Rectangle Shape AWT, Swing, JavaFX & SWT 2
N JavaFX Stranges Problem mit der Autoscroll-Eigenschaft von Textareas AWT, Swing, JavaFX & SWT 0
E Java FX FXML Problem mit html Scriptausführung AWT, Swing, JavaFX & SWT 2
J JavaFX Intersect Problem mit Shapes AWT, Swing, JavaFX & SWT 10
R JavaFX MediaPlayer AVI-Problem AWT, Swing, JavaFX & SWT 1
M Swing Problem mit ListCellRenderer AWT, Swing, JavaFX & SWT 7
D Problem mit JTable AWT, Swing, JavaFX & SWT 1
F GUI Auflösung ändern - Koordianten und Proportions Problem AWT, Swing, JavaFX & SWT 21
J Problem mit Button darstellung AWT, Swing, JavaFX & SWT 23
M Problem mit Layoutmanagern... Hilfe wäre sehr nett. AWT, Swing, JavaFX & SWT 2
S 2D-Grafik Problem mit Variablen AWT, Swing, JavaFX & SWT 4
7 JavaFX Problem beim Zeichnen eines Dreiecks in einem GUI AWT, Swing, JavaFX & SWT 6
M Swing AttributiveCellTableModel addRow() Problem AWT, Swing, JavaFX & SWT 1
J Swing Problem mit Graphics Methode AWT, Swing, JavaFX & SWT 4
N JavaFX Problem mit table multiple selection AWT, Swing, JavaFX & SWT 5
K CheckBox Problem AWT, Swing, JavaFX & SWT 5
Grevak DisplayMode Problem seit Windows 10 AWT, Swing, JavaFX & SWT 2
S Swing Eigene JComboBox Problem! AWT, Swing, JavaFX & SWT 1
B Swing Problem mit Bildpfad AWT, Swing, JavaFX & SWT 4
N Swing Problem beim Scrollen mit JScrollPane AWT, Swing, JavaFX & SWT 6
V Graphics g - drawOval problem mit background AWT, Swing, JavaFX & SWT 1
C AWT Problem mit Protokol Fenster AWT, Swing, JavaFX & SWT 0
M Swing pack() Problem mit Taskleiste AWT, Swing, JavaFX & SWT 4
N Swing Choice- Problem! AWT, Swing, JavaFX & SWT 8
Q "AWT-EventQueue-0" Exception Problem AWT, Swing, JavaFX & SWT 4
D jButton Problem, ein Rieser Button bedeckt das ganze frame AWT, Swing, JavaFX & SWT 1
A Problem: repaint() - Schleife AWT, Swing, JavaFX & SWT 3
J Anfänger GUI Problem bei der Ausführung eines sehr einfachen Programms AWT, Swing, JavaFX & SWT 2
P AWT Problem mit Platzierung (GridBagLayout) AWT, Swing, JavaFX & SWT 2
N Swing JTree Problem beim erstellen der Knoten AWT, Swing, JavaFX & SWT 0
N Swing CardLayout: Problem beim Wechsel zwischen den JPanels AWT, Swing, JavaFX & SWT 3
A Mini-Menu-Schriften. Ein Problem bei hohen DPI Zahlen AWT, Swing, JavaFX & SWT 2
Z Canvas in Frame einfügen. Problem mit 4-Gewinnt AWT, Swing, JavaFX & SWT 1
C Thread-/ Simulations- Problem AWT, Swing, JavaFX & SWT 18
G Swing Setvisible problem AWT, Swing, JavaFX & SWT 1
J JTabbedPane: close Button Problem AWT, Swing, JavaFX & SWT 2
Tom299 JavaFX -> fxmlLoader -> getResourceAsStream Problem AWT, Swing, JavaFX & SWT 1
T Problem: ComboBox und addItem AWT, Swing, JavaFX & SWT 5
M JTextArea wird nicht aktualisiert (ActionListener-Problem) AWT, Swing, JavaFX & SWT 1
T LayoutManager LookAndFeel-Problem AWT, Swing, JavaFX & SWT 4
F Problem mit Implementierung von Kollisionsabfrage AWT, Swing, JavaFX & SWT 5
vodkaz (javafx) Image Problem AWT, Swing, JavaFX & SWT 2
T Problem beim Zeichnen von Rechteck AWT, Swing, JavaFX & SWT 3
B JavaFX Problem bei Kamera / Group, gesamte Scene bewegt sich mit AWT, Swing, JavaFX & SWT 0
L Swing Vier Gewinnt Problem AWT, Swing, JavaFX & SWT 2
Z GUI-Problem, finde meinen Fehler nicht! AWT, Swing, JavaFX & SWT 11
B JavaFX KeyEvent und Canvas draw Problem AWT, Swing, JavaFX & SWT 9
R Swing Problem: IOException bei ActionListener AWT, Swing, JavaFX & SWT 1
GianaSisters JFrame mit JInternalFrames, Keylistener-Problem AWT, Swing, JavaFX & SWT 9

Ähnliche Java Themen

Neue Themen


Oben