Frame im Frame?

ballibum

Aktives Mitglied
Guten morgen tolles Forum,
ich habe eine kleine aber feine Oberfläche programmiert und möchte nun ein Frame einer bereits existierenden Anwendung in meine Anwendung integrieren. Momentan habe ich es so gelöst, das einfach ein zweites Frame aufgeht, aber das sieht optisch nicht so schick aus, kann ich das irgendwie realisieren.

Ich habe es mal versucht über Tab-Panes darzustellen, was ich vorhabe:

Java:
package _oberflaeche;

import java.awt.BorderLayout;

public class openjumpnew extends JFrame {

	private JPanel contentPane;
	private WorkbenchFrame frame2;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					openjumpnew frame = new openjumpnew();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 * @throws Exception 
	 */
	public openjumpnew() throws Exception {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 823, 595);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 567, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(238, Short.MAX_VALUE))
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 467, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(84, Short.MAX_VALUE))
		);
		
		JPanel panel = new JPanel();
		tabbedPane.addTab("New tab", null, panel, null);
		
		JPanel panel_1 = new JPanel();
		frame2 = new WorkbenchFrame("huhu", null);
		frame2.setVisible(true);
		panel_1.add(frame2);
		
		tabbedPane.addTab("New tab", null, panel_1, null);
		contentPane.setLayout(gl_contentPane);
		
	}
}

vielen Dank für Hinweise und Hilfe
Balli
 
Okay danke, wenn ich das so mache ist schonmal das "extra" Frame in einem meiner Panels verschwunden, jedoch ist dieses jetzt nicht mehr vollständig. Kann es sein das ich nicht alle Panels (Menübar, Toolbar etc) mit getContentPane() erhalte? Gibt es etwas wie getAll()
 

Neue Themen


Zurück
Oben