GridBagLayout layout = new GridBagLayout(); GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = constraints.BOTH; constraints.weightx = 1.0f; Container content = getContentPane(); content.setLayout(layout); JPanel panel = createLfPanel(); layout.setConstraints(panel,constraints); content.add(panel); constraints.gridy = 1; panel = createOpeningPanel(); layout.setConstraints(panel,constraints); content.add(panel); constraints.gridy = 2; panel = createSavingPanel(); layout.setConstraints(panel,constraints); content.add(panel); constraints.gridy = 3; panel = createEditingPanel(); layout.setConstraints(panel,constraints); content.add(panel); constraints.gridy = 4; panel = createPrintingPanel(); layout.setConstraints(panel,constraints); content.add(panel); constraints.gridy = 5; panel = createButtonsPanel(); layout.setConstraints(panel,constraints); content.add(panel);
getContentPane().setLayout(new BorderLayout()); panes = new Vector(); tabs = new JTabbedPane(); addOptionPane(new GeneralOptionPane()); addOptionPane(new EditorOptionPane()); addOptionPane(new ColorsOptionPane()); getContentPane().add("Center",tabs); JPanel buttons = new JPanel(); ok = new JButton(jEdit.getProperty("options.ok")); ok.addActionListener(this); buttons.add(ok); getRootPane().setDefaultButton(ok); cancel = new JButton(jEdit.getProperty("options.cancel")); cancel.addActionListener(this); buttons.add(cancel); getContentPane().add("South",buttons); addKeyListener(this); addWindowListener(this);
	public Options(View view)	{		super(view,jEdit.getProperty("options.title"),true);		GridBagLayout layout = new GridBagLayout();		GridBagConstraints constraints = new GridBagConstraints();		constraints.fill = constraints.BOTH;		constraints.weightx = 1.0f;		Container content = getContentPane();		content.setLayout(layout);		JPanel panel = createLfPanel();		layout.setConstraints(panel,constraints);		content.add(panel);		constraints.gridy = 1;		panel = createOpeningPanel();		layout.setConstraints(panel,constraints);		content.add(panel);		constraints.gridy = 2;		panel = createSavingPanel();		layout.setConstraints(panel,constraints);		content.add(panel);		constraints.gridy = 3;		panel = createEditingPanel();		layout.setConstraints(panel,constraints);		content.add(panel);		constraints.gridy = 4;		panel = createPrintingPanel();		layout.setConstraints(panel,constraints);		content.add(panel);		constraints.gridy = 5;		panel = createButtonsPanel();		layout.setConstraints(panel,constraints);		content.add(panel);		Dimension screen = getToolkit().getScreenSize();		pack();		setLocation((screen.width - getSize().width) / 2,			(screen.height - getSize().height) / 2);		setDefaultCloseOperation(DISPOSE_ON_CLOSE);		show();	}