List of usage examples for javax.swing JDialog setSize
public void setSize(Dimension d)
The d.width and d.height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .
From source file:es.emergya.ui.base.Message.java
private void inicializar(final String texto) { log.trace("inicializar(" + texto + ")"); final Message message_ = this; SwingUtilities.invokeLater(new Runnable() { @Override//ww w. j av a2 s. com public void run() { log.trace("Sacamos un nuevo mensaje: " + texto); JDialog frame = new JDialog(window.getFrame(), true); frame.setUndecorated(true); frame.getContentPane().setBackground(Color.WHITE); frame.setLocation(150, window.getHeight() - 140); frame.setSize(new Dimension(window.getWidth() - 160, 130)); frame.setName("Incoming Message"); frame.setBackground(Color.WHITE); frame.getRootPane().setBorder(new MatteBorder(4, 4, 4, 4, color)); frame.setLayout(new BorderLayout()); if (font != null) frame.setFont(font); JLabel icon = new JLabel(new ImageIcon(this.getClass().getResource("/images/button-ok.png"))); icon.setToolTipText("Cerrar"); icon.removeMouseListener(null); icon.addMouseListener(new Cerrar(frame, message_)); JLabel text = new JLabel(texto); text.setBackground(Color.WHITE); text.setForeground(Color.BLACK); frame.add(text, BorderLayout.WEST); frame.add(icon, BorderLayout.EAST); frame.setVisible(true); } }); }
From source file:com.net2plan.gui.GUINet2Plan.java
private void showKeyCombinations() { Component component = container.getComponent(0); if (!(component instanceof IGUIModule)) { ErrorHandling.showErrorDialog("No tool is active", "Unable to show key associations"); return;/* ww w . j a va 2 s .c o m*/ } final JDialog dialog = new JDialog(); dialog.setTitle("Key combinations"); SwingUtils.configureCloseDialogOnEscape(dialog); dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); dialog.setSize(new Dimension(500, 300)); dialog.setLocationRelativeTo(null); dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); dialog.setLayout(new MigLayout("fill, insets 0 0 0 0")); final String[] tableHeader = StringUtils.arrayOf("Key combination", "Action"); DefaultTableModel model = new ClassAwareTableModel(); model.setDataVector(new Object[1][tableHeader.length], tableHeader); AdvancedJTable table = new AdvancedJTable(model); JScrollPane scrollPane = new JScrollPane(table); dialog.add(scrollPane, "grow"); RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(model); table.setRowSorter(sorter); table.getTableHeader().addMouseListener(new ColumnFitAdapter()); IGUIModule module = (IGUIModule) component; Map<String, KeyStroke> keyCombinations = module.getKeyCombinations(); if (!keyCombinations.isEmpty()) { model.removeRow(0); for (Entry<String, KeyStroke> keyCombination : keyCombinations.entrySet()) { String description = keyCombination.getKey(); KeyStroke keyStroke = keyCombination.getValue(); model.addRow(StringUtils.arrayOf(description, keyStroke.toString().replaceAll(" pressed ", " "))); } } dialog.setVisible(true); }
From source file:com.net2plan.gui.utils.onlineSimulationPane.OnlineSimulationPane.java
/** * Shows the future event list./*from w w w . ja v a 2 s. co m*/ * * @since 0.3.0 */ public void viewFutureEventList() { final JDialog dialog = new JDialog(); dialog.setTitle("Future event list"); SwingUtils.configureCloseDialogOnEscape(dialog); dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); dialog.setSize(new Dimension(500, 300)); dialog.setLocationRelativeTo(null); dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); dialog.setLayout(new MigLayout("fill, insets 0 0 0 0")); final String[] tableHeader = StringUtils.arrayOf("Id", "Time", "Priority", "Type", "To module", "Custom object"); Object[][] data = new Object[1][tableHeader.length]; DefaultTableModel model = new ClassAwareTableModel(); model.setDataVector(new Object[1][tableHeader.length], tableHeader); JTable table = new AdvancedJTable(model); RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(model); table.setRowSorter(sorter); JScrollPane scrollPane = new JScrollPane(table); dialog.add(scrollPane, "grow"); PriorityQueue<SimEvent> futureEventList = simKernel.getSimCore().getFutureEventList().getPendingEvents(); if (!futureEventList.isEmpty()) { int numEvents = futureEventList.size(); SimEvent[] futureEventList_array = futureEventList.toArray(new SimEvent[numEvents]); Arrays.sort(futureEventList_array, futureEventList.comparator()); data = new Object[numEvents][tableHeader.length]; for (int eventId = 0; eventId < numEvents; eventId++) { // List<SimAction> actions = futureEventList_array[eventId].getEventActionList(); Object customObject = futureEventList_array[eventId].getEventObject(); data[eventId][0] = eventId; data[eventId][1] = StringUtils .secondsToYearsDaysHoursMinutesSeconds(futureEventList_array[eventId].getEventTime()); data[eventId][2] = futureEventList_array[eventId].getEventPriority(); data[eventId][3] = futureEventList_array[eventId].getEventType(); data[eventId][4] = futureEventList_array[eventId].getEventDestinationModule().toString(); data[eventId][5] = customObject == null ? "none" : customObject; } } model.setDataVector(data, tableHeader); table.getTableHeader().addMouseListener(new ColumnFitAdapter()); table.setDefaultRenderer(Double.class, new CellRenderers.NumberCellRenderer()); dialog.setVisible(true); }
From source file:com.anrisoftware.prefdialog.spreadsheetimportdialog.dialog.SpreadsheetImportDialogWorker.java
@Override protected JDialog createDialog() { JDialog jdialog = new JDialog(parentWindow, APPLICATION_MODAL); jdialog.setLocale(getLocale());/*from ww w . j a v a 2 s . c o m*/ SpreadsheetImportDialog importDialog; importDialog = spreadsheetImportDialogFactory.create(savedProperties); importDialog.setParentInjector(parent); importDialog.setDialog(jdialog); importDialog.createDialog(parentWindow, importerFactory); setupSavedProperties(properties, savedProperties); importDialog.setPropertiesNoChecks(properties); jdialog.pack(); jdialog.setSize(size); jdialog.setTitle(getDialogTitleFromResource()); jdialog.setLocationRelativeTo(parentWindow); insertListeners(importDialog); this.importDialog = new SoftReference<SpreadsheetImportDialog>(importDialog); return jdialog; }
From source file:com.eviware.soapui.support.SoapUIVersionUpdate.java
public void showNewVersionDownloadDialog() { JPanel versionUpdatePanel = new JPanel(new BorderLayout()); JDialog dialog = new JDialog(); versionUpdatePanel.add(UISupport.buildDescription("New Version of SoapUI is Available", "", null), BorderLayout.NORTH);//ww w . j av a2 s. co m JEditorPane text = createReleaseNotesPane(); JScrollPane scb = new JScrollPane(text); versionUpdatePanel.add(scb, BorderLayout.CENTER); JPanel toolbar = buildToolbar(dialog); versionUpdatePanel.add(toolbar, BorderLayout.SOUTH); dialog.setTitle("New Version Update"); dialog.setModal(true); dialog.getContentPane().add(versionUpdatePanel); dialog.setSize(new Dimension(500, 640)); UISupport.centerDialog(dialog, SoapUI.getFrame()); dialog.setVisible(true); }
From source file:com.att.aro.ui.view.diagnostictab.GraphPanel.java
public void launchSliderDialog(int indexKey) { GoogleAnalyticsUtil.getGoogleAnalyticsInstance().sendViews("StartupDelayDialog"); IVideoPlayer player = parent.getVideoPlayer(); double maxDuration = player.getDuration(); if (maxDuration != -1) { JDialog dialog = new SliderDialogBox(this, maxDuration, chunkInfo, indexKey, vcPlot.getAllChunks()); dialog.pack();//from w w w .ja v a2 s . c o m dialog.setSize(dialog.getPreferredSize()); dialog.validate(); dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); } }
From source file:com.biosis.biosislite.vistas.AsignarPermiso.java
private void imprimirBoletaViaje(AsignacionPermiso asignacion) { File reporte = new File("reportes/permiso_comision-servicios.jasper"); List<AsignacionPermiso> listadoReporteAsignacion = new ArrayList(); listadoReporteAsignacion.add(asignacion); Map<String, Object> parametros = new HashMap<>(); parametros.put("reporte_ususario", UsuarioActivo.getUsuario().getLogin()); Departamento area = asignacion.getEmpleado().getAreaEmpleadoList().get(0).getDepartamento(); if (area != null) { parametros.put("area", area.getNombre()); }/*from w w w. j a va 2s. c om*/ // AsignarVacacion vac = new AsignarVacacion(); long dias = this.fechasAlong(asignacion.getPermiso().getFechaInicio(), asignacion.getPermiso().getFechaFin()); parametros.put("dias", dias); //Parametros del viaje Viaje viaje = vsc.buscarPorPermiso(asignacion.getPermiso()); if (viaje != null) { parametros.put("alimentacion", viaje.getAlimentacion()); parametros.put("alojamiento", viaje.getAlojamiento()); parametros.put("movilidad", viaje.getMovilidad()); parametros.put("combustible", viaje.getCombustible()); parametros.put("dias_alimentacion", viaje.getDiasAlimentacion()); parametros.put("dias_alojamiento", viaje.getDiasAlojamiento()); parametros.put("dias_movilidad", viaje.getDiasMovLocal()); // if (asignacion.getEmpleado().getAreaEmpleadoList().get(0).getDepartamento().getDepartamento().getNombre() != null) { // parametros.put("gerencia", asignacion.getEmpleado().getAreaEmpleadoList().get(0).getDepartamento().getDepartamento().getNombre()); // } else { parametros.put("gerencia", asignacion.getEmpleado().getAreaEmpleadoList().get(0).getGerencia().getNombre()); // } parametros.put("centro_costo", viaje.getCentroCosto()); parametros.put("ubigeo", viaje.getDestino()); parametros.put("cargo", asignacion.getEmpleado().getPuestoList().get(0).getPuesto().getNombre()); double total = (viaje.getAlimentacion() * viaje.getDiasAlimentacion()) + (viaje.getAlojamiento() * viaje.getDiasAlojamiento()) + (viaje.getMovilidad() * viaje.getDiasMovLocal()) + viaje.getCombustible(); parametros.put("total", total); } //Fin de parametros del viaje Component contentPane = reporteador.obtenerReporte(listadoReporteAsignacion, reporte, parametros); Frame principal = JOptionPane.getRootFrame(); JDialog visor = new JDialog(principal, "Reporte", true); visor.setSize(contentPane.getSize()); // visor.setSize(ventana.getSize().width, ventana.getSize().height); visor.getContentPane().add(contentPane); visor.setLocationRelativeTo(this); // visor.setUndecorated(true); visor.setBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()); visor.setVisible(true); visor.setAlwaysOnTop(true); // reporteador.getReporte(reporte, parametros, listado) // reporteador.setConn(controlador.getDao().getConexion()); // reporteador.generarReporte(reporte, parametros, JOptionPane.getFrameForComponent(this)); }
From source file:components.DialogDemo.java
/** Creates the panel shown by the second tab. */ private JPanel createFeatureDialogBox() { final int numButtons = 5; JRadioButton[] radioButtons = new JRadioButton[numButtons]; final ButtonGroup group = new ButtonGroup(); JButton showItButton = null;/* w w w . ja v a2 s . c om*/ final String pickOneCommand = "pickone"; final String textEnteredCommand = "textfield"; final String nonAutoCommand = "nonautooption"; final String customOptionCommand = "customoption"; final String nonModalCommand = "nonmodal"; radioButtons[0] = new JRadioButton("Pick one of several choices"); radioButtons[0].setActionCommand(pickOneCommand); radioButtons[1] = new JRadioButton("Enter some text"); radioButtons[1].setActionCommand(textEnteredCommand); radioButtons[2] = new JRadioButton("Non-auto-closing dialog"); radioButtons[2].setActionCommand(nonAutoCommand); radioButtons[3] = new JRadioButton("Input-validating dialog " + "(with custom message area)"); radioButtons[3].setActionCommand(customOptionCommand); radioButtons[4] = new JRadioButton("Non-modal dialog"); radioButtons[4].setActionCommand(nonModalCommand); for (int i = 0; i < numButtons; i++) { group.add(radioButtons[i]); } radioButtons[0].setSelected(true); showItButton = new JButton("Show it!"); showItButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String command = group.getSelection().getActionCommand(); //pick one of many if (command == pickOneCommand) { Object[] possibilities = { "ham", "spam", "yam" }; String s = (String) JOptionPane.showInputDialog(frame, "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, icon, possibilities, "ham"); //If a string was returned, say so. if ((s != null) && (s.length() > 0)) { setLabel("Green eggs and... " + s + "!"); return; } //If you're here, the return value was null/empty. setLabel("Come on, finish the sentence!"); //text input } else if (command == textEnteredCommand) { String s = (String) JOptionPane.showInputDialog(frame, "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, icon, null, "ham"); //If a string was returned, say so. if ((s != null) && (s.length() > 0)) { setLabel("Green eggs and... " + s + "!"); return; } //If you're here, the return value was null/empty. setLabel("Come on, finish the sentence!"); //non-auto-closing dialog } else if (command == nonAutoCommand) { final JOptionPane optionPane = new JOptionPane( "The only way to close this dialog is by\n" + "pressing one of the following buttons.\n" + "Do you understand?", JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION); //You can't use pane.createDialog() because that //method sets up the JDialog with a property change //listener that automatically closes the window //when a button is clicked. final JDialog dialog = new JDialog(frame, "Click a button", true); dialog.setContentPane(optionPane); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); dialog.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { setLabel("Thwarted user attempt to close window."); } }); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (JOptionPane.VALUE_PROPERTY.equals(prop))) { //If you were going to check something //before closing the window, you'd do //it here. dialog.setVisible(false); } } }); dialog.pack(); dialog.setLocationRelativeTo(frame); dialog.setVisible(true); int value = ((Integer) optionPane.getValue()).intValue(); if (value == JOptionPane.YES_OPTION) { setLabel("Good."); } else if (value == JOptionPane.NO_OPTION) { setLabel("Try using the window decorations " + "to close the non-auto-closing dialog. " + "You can't!"); } else { setLabel("Window unavoidably closed (ESC?)."); } //non-auto-closing dialog with custom message area //NOTE: if you don't intend to check the input, //then just use showInputDialog instead. } else if (command == customOptionCommand) { customDialog.setLocationRelativeTo(frame); customDialog.setVisible(true); String s = customDialog.getValidatedText(); if (s != null) { //The text is valid. setLabel("Congratulations! " + "You entered \"" + s + "\"."); } //non-modal dialog } else if (command == nonModalCommand) { //Create the dialog. final JDialog dialog = new JDialog(frame, "A Non-Modal Dialog"); //Add contents to it. It must have a close button, //since some L&Fs (notably Java/Metal) don't provide one //in the window decorations for dialogs. JLabel label = new JLabel("<html><p align=center>" + "This is a non-modal dialog.<br>" + "You can have one or more of these up<br>" + "and still use the main window."); label.setHorizontalAlignment(JLabel.CENTER); Font font = label.getFont(); label.setFont(label.getFont().deriveFont(font.PLAIN, 14.0f)); JButton closeButton = new JButton("Close"); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.setVisible(false); dialog.dispose(); } }); JPanel closePanel = new JPanel(); closePanel.setLayout(new BoxLayout(closePanel, BoxLayout.LINE_AXIS)); closePanel.add(Box.createHorizontalGlue()); closePanel.add(closeButton); closePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 5)); JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(label, BorderLayout.CENTER); contentPane.add(closePanel, BorderLayout.PAGE_END); contentPane.setOpaque(true); dialog.setContentPane(contentPane); //Show it. dialog.setSize(new Dimension(300, 150)); dialog.setLocationRelativeTo(frame); dialog.setVisible(true); } } }); return createPane(moreDialogDesc + ":", radioButtons, showItButton); }
From source file:DialogDemo.java
/** Creates the panel shown by the second tab. */ private JPanel createFeatureDialogBox() { final int numButtons = 5; JRadioButton[] radioButtons = new JRadioButton[numButtons]; final ButtonGroup group = new ButtonGroup(); JButton showItButton = null;/* w w w.j a va2s. c o m*/ final String pickOneCommand = "pickone"; final String textEnteredCommand = "textfield"; final String nonAutoCommand = "nonautooption"; final String customOptionCommand = "customoption"; final String nonModalCommand = "nonmodal"; radioButtons[0] = new JRadioButton("Pick one of several choices"); radioButtons[0].setActionCommand(pickOneCommand); radioButtons[1] = new JRadioButton("Enter some text"); radioButtons[1].setActionCommand(textEnteredCommand); radioButtons[2] = new JRadioButton("Non-auto-closing dialog"); radioButtons[2].setActionCommand(nonAutoCommand); radioButtons[3] = new JRadioButton("Input-validating dialog " + "(with custom message area)"); radioButtons[3].setActionCommand(customOptionCommand); radioButtons[4] = new JRadioButton("Non-modal dialog"); radioButtons[4].setActionCommand(nonModalCommand); for (int i = 0; i < numButtons; i++) { group.add(radioButtons[i]); } radioButtons[0].setSelected(true); showItButton = new JButton("Show it!"); showItButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String command = group.getSelection().getActionCommand(); // pick one of many if (command == pickOneCommand) { Object[] possibilities = { "ham", "spam", "yam" }; String s = (String) JOptionPane.showInputDialog(frame, "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, icon, possibilities, "ham"); // If a string was returned, say so. if ((s != null) && (s.length() > 0)) { setLabel("Green eggs and... " + s + "!"); return; } // If you're here, the return value was null/empty. setLabel("Come on, finish the sentence!"); // text input } else if (command == textEnteredCommand) { String s = (String) JOptionPane.showInputDialog(frame, "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, icon, null, "ham"); // If a string was returned, say so. if ((s != null) && (s.length() > 0)) { setLabel("Green eggs and... " + s + "!"); return; } // If you're here, the return value was null/empty. setLabel("Come on, finish the sentence!"); // non-auto-closing dialog } else if (command == nonAutoCommand) { final JOptionPane optionPane = new JOptionPane( "The only way to close this dialog is by\n" + "pressing one of the following buttons.\n" + "Do you understand?", JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION); // You can't use pane.createDialog() because that // method sets up the JDialog with a property change // listener that automatically closes the window // when a button is clicked. final JDialog dialog = new JDialog(frame, "Click a button", true); dialog.setContentPane(optionPane); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); dialog.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { setLabel("Thwarted user attempt to close window."); } }); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (JOptionPane.VALUE_PROPERTY.equals(prop))) { // If you were going to check something // before closing the window, you'd do // it here. dialog.setVisible(false); } } }); dialog.pack(); dialog.setLocationRelativeTo(frame); dialog.setVisible(true); int value = ((Integer) optionPane.getValue()).intValue(); if (value == JOptionPane.YES_OPTION) { setLabel("Good."); } else if (value == JOptionPane.NO_OPTION) { setLabel("Try using the window decorations " + "to close the non-auto-closing dialog. " + "You can't!"); } else { setLabel("Window unavoidably closed (ESC?)."); } // non-auto-closing dialog with custom message area // NOTE: if you don't intend to check the input, // then just use showInputDialog instead. } else if (command == customOptionCommand) { customDialog.setLocationRelativeTo(frame); customDialog.setVisible(true); String s = customDialog.getValidatedText(); if (s != null) { // The text is valid. setLabel("Congratulations! " + "You entered \"" + s + "\"."); } // non-modal dialog } else if (command == nonModalCommand) { // Create the dialog. final JDialog dialog = new JDialog(frame, "A Non-Modal Dialog"); // Add contents to it. It must have a close button, // since some L&Fs (notably Java/Metal) don't provide one // in the window decorations for dialogs. JLabel label = new JLabel("<html><p align=center>" + "This is a non-modal dialog.<br>" + "You can have one or more of these up<br>" + "and still use the main window."); label.setHorizontalAlignment(JLabel.CENTER); Font font = label.getFont(); label.setFont(label.getFont().deriveFont(font.PLAIN, 14.0f)); JButton closeButton = new JButton("Close"); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.setVisible(false); dialog.dispose(); } }); JPanel closePanel = new JPanel(); closePanel.setLayout(new BoxLayout(closePanel, BoxLayout.LINE_AXIS)); closePanel.add(Box.createHorizontalGlue()); closePanel.add(closeButton); closePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 5)); JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(label, BorderLayout.CENTER); contentPane.add(closePanel, BorderLayout.PAGE_END); contentPane.setOpaque(true); dialog.setContentPane(contentPane); // Show it. dialog.setSize(new Dimension(300, 150)); dialog.setLocationRelativeTo(frame); dialog.setVisible(true); } } }); return createPane(moreDialogDesc + ":", radioButtons, showItButton); }
From source file:pcgen.gui2.PCGenFrame.java
private void showLicenseDialog(String title, String htmlString) { if (htmlString == null) { htmlString = LanguageBundle.getString("in_licNoInfo"); //$NON-NLS-1$ }//from ww w . j a v a 2s .com final PropertyContext context = PCGenSettings.OPTIONS_CONTEXT; final JDialog aFrame = new JDialog(this, title, true); final JButton jClose = new JButton(LanguageBundle.getString("in_close")); //$NON-NLS-1$ jClose.setMnemonic(LanguageBundle.getMnemonic("in_mn_close")); //$NON-NLS-1$ final JPanel jPanel = new JPanel(); final JCheckBox jCheckBox = new JCheckBox(LanguageBundle.getString("in_licShowOnLoad")); //$NON-NLS-1$ jPanel.add(jCheckBox); jCheckBox.setSelected(context.getBoolean(PCGenSettings.OPTION_SHOW_LICENSE)); jCheckBox.addItemListener( evt -> context.setBoolean(PCGenSettings.OPTION_SHOW_LICENSE, jCheckBox.isSelected())); jPanel.add(jClose); jClose.addActionListener(evt -> aFrame.dispose()); HtmlPanel htmlPanel = new HtmlPanel(); HtmlRendererContext theRendererContext = new SimpleHtmlRendererContext(htmlPanel, new SimpleUserAgentContext()); htmlPanel.setHtml(htmlString, "", theRendererContext); aFrame.getContentPane().setLayout(new BorderLayout()); aFrame.getContentPane().add(htmlPanel, BorderLayout.CENTER); aFrame.getContentPane().add(jPanel, BorderLayout.SOUTH); aFrame.setSize(new Dimension(700, 500)); aFrame.setLocationRelativeTo(this); Utility.setComponentRelativeLocation(this, aFrame); aFrame.getRootPane().setDefaultButton(jClose); Utility.installEscapeCloseOperation(aFrame); aFrame.setVisible(true); }