Java Code Examples for org.eclipse.swt.graphics.GC#setFont()
The following examples show how to use
org.eclipse.swt.graphics.GC#setFont() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GanttChartPrintJob.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * Render the footer to a print page. * @param gc The graphical context that is used for printing * @param ganttChart The GanttChart which is currently printed. * @param currentPage The number of the current page that is printed * @param printBounds The bounds of the print area */ private void printFooter(GC gc, GanttChart ganttChart, int currentPage, Rectangle printBounds) { String footerDate = new SimpleDateFormat(ganttChart.getSettings().getDateFormat()).format(new Date()); gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK)); gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); gc.setFont(Display.getCurrent().getSystemFont()); gc.drawLine(printBounds.x, printBounds.y + printBounds.height+10, printBounds.x + printBounds.width, printBounds.y + printBounds.height+10); String pageText = ganttChart.getLanguageManger().getPrintPageText() + " " + currentPage; //$NON-NLS-1$ gc.drawString(pageText, printBounds.x, printBounds.y + printBounds.height + 15); Point dateExtend = gc.stringExtent(footerDate); gc.drawString(footerDate, printBounds.x + printBounds.width - dateExtend.x, printBounds.y + printBounds.height + 15); }
Example 2
Source File: LauncherLabel.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * Compute the size of the content (image + text + gap) * * @param imgWidth image width * @param imgHeight image height * @return the size of the content */ private Point getTotalSize(final int imgWidth, final int imgHeight) { final Point size = new Point(0, 0); int textWidth = 0; int textHeight = 0; if (textSize == null) { final GC gc = new GC(this); gc.setFont(font); textSize = gc.textExtent(text, DRAW_FLAGS); gc.dispose(); } textWidth = textSize.x; textHeight = textSize.y; size.x = Math.max(imgWidth, textWidth); size.y = imgHeight + GAP + textHeight; return size; }
Example 3
Source File: CodeAssistAdvancedConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private int computeWidth(Control control, String name) { if (name == null) return 0; GC gc= new GC(control); try { gc.setFont(JFaceResources.getDialogFont()); return gc.stringExtent(name).x + 10; } finally { gc.dispose(); } }
Example 4
Source File: ColorEditor.java From Pydev with Eclipse Public License 1.0 | 5 votes |
protected Point computeImageSize(Control window) { GC gc = new GC(window); Font f = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); gc.setFont(f); int height = gc.getFontMetrics().getHeight(); gc.dispose(); Point p = new Point(height * 3 - 6, height); return p; }
Example 5
Source File: SpanStylePaintInstruction.java From nebula with Eclipse Public License 2.0 | 5 votes |
@Override public FontMetrics getFontMetrics(GC gc) { if (this.fontSize != null || this.fontType != null) { Font currentFont = gc.getFont(); this.state.addPreviousFont(currentFont); gc.setFont(ResourceHelper.getFont(currentFont, this.fontType, this.fontSize)); } return gc.getFontMetrics(); }
Example 6
Source File: SWTUtils.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Create an awt font by converting as much information * as possible from the provided swt <code>FontData</code>. * <p>Generally speaking, given a font size, an swt font will * display differently on the screen than the corresponding awt * one. Because the SWT toolkit use native graphical ressources whenever * it is possible, this fact is platform dependent. To address * this issue, it is possible to enforce the method to return * an awt font with the same height as the swt one. * * @param device The swt device being drawn on (display or gc device). * @param fontData The swt font to convert. * @param ensureSameSize A boolean used to enforce the same size * (in pixels) between the swt font and the newly created awt font. * @return An awt font converted from the provided swt font. */ public static java.awt.Font toAwtFont(Device device, FontData fontData, boolean ensureSameSize) { int height = (int) Math.round(fontData.getHeight() * device.getDPI().y / 72.0); // hack to ensure the newly created awt fonts will be rendered with the // same height as the swt one if (ensureSameSize) { GC tmpGC = new GC(device); Font tmpFont = new Font(device, fontData); tmpGC.setFont(tmpFont); JPanel DUMMY_PANEL = new JPanel(); java.awt.Font tmpAwtFont = new java.awt.Font(fontData.getName(), fontData.getStyle(), height); if (DUMMY_PANEL.getFontMetrics(tmpAwtFont).stringWidth(Az) > tmpGC.textExtent(Az).x) { while (DUMMY_PANEL.getFontMetrics(tmpAwtFont).stringWidth(Az) > tmpGC.textExtent(Az).x) { height--; tmpAwtFont = new java.awt.Font(fontData.getName(), fontData.getStyle(), height); } } else if (DUMMY_PANEL.getFontMetrics(tmpAwtFont).stringWidth(Az) < tmpGC.textExtent(Az).x) { while (DUMMY_PANEL.getFontMetrics(tmpAwtFont).stringWidth(Az) < tmpGC.textExtent(Az).x) { height++; tmpAwtFont = new java.awt.Font(fontData.getName(), fontData.getStyle(), height); } } tmpFont.dispose(); tmpGC.dispose(); } return new java.awt.Font(fontData.getName(), fontData.getStyle(), height); }
Example 7
Source File: CellRenderer.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * {@inheritDoc} */ public Rectangle getTextBounds(GridItem item, boolean preferred) { int x = leftMargin; if (isTree()) { x += getToggleIndent(item); x += toggleRenderer.getBounds().width + insideMargin; } if (isCheck()) { x += checkRenderer.getBounds().width + insideMargin; } Image image = item.getImage(getColumn()); if (image != null) { x += image.getBounds().width + insideMargin; } Rectangle bounds = new Rectangle(x, topMargin + textTopMargin, 0, 0); GC gc = new GC(item.getParent()); gc.setFont(item.getFont(getColumn())); Point size = gc.stringExtent(item.getText(getColumn())); bounds.height = size.y; if (preferred) { bounds.width = size.x - 1; } else { bounds.width = getBounds().width - x - rightMargin; } gc.dispose(); return bounds; }
Example 8
Source File: TabbedPropertyTitle.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * @return the height of the title. */ public int getHeight( ) { Shell shell = new Shell( ); GC gc = new GC( shell ); gc.setFont( getFont( ) ); Point point = gc.textExtent( BLANK ); point.x++; int textOrImageHeight = Math.max( point.x, 16 ); gc.dispose( ); shell.dispose( ); return textOrImageHeight + 8; }
Example 9
Source File: ModeLineFlasher.java From e4macs with Eclipse Public License 1.0 | 5 votes |
/** * Returns the width hint for this label. * * @param control the root control of this label * @return the width hint for this label * @since 2.1 */ private int getWidthHint(Composite control) { if (fFixedWidth < 0) { GC gc= new GC(control); gc.setFont(control.getFont()); fFixedWidth = (int) gc.getFontMetrics().getAverageCharacterWidth() * fWidthInChars; fFixedWidth += INDENT * 2; gc.dispose(); } return fFixedWidth; }
Example 10
Source File: SourceViewerInformationControl.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public Point computeSizeConstraints(int widthInChars, int heightInChars) { GC gc= new GC(fText); gc.setFont(fTextFont); int width= gc.getFontMetrics().getAverageCharWidth(); int height= fText.getLineHeight(); //https://bugs.eclipse.org/bugs/show_bug.cgi?id=377109 gc.dispose(); return new Point(widthInChars * width, heightInChars * height); }
Example 11
Source File: CommonLineNumberRulerColumn.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * Computes the indentations for the given font and stores them in * <code>fIndentation</code>. */ protected void computeIndentations() { if (fCanvas == null || fCanvas.isDisposed()) return; GC gc= new GC(fCanvas); try { gc.setFont(fCanvas.getFont()); fIndentation= new int[fCachedNumberOfDigits + 1]; char[] nines= new char[fCachedNumberOfDigits]; Arrays.fill(nines, '9'); String nineString= new String(nines); Point p= gc.stringExtent(nineString); fIndentation[0]= p.x; for (int i= 1; i <= fCachedNumberOfDigits; i++) { p= gc.stringExtent(nineString.substring(0, i)); fIndentation[i]= fIndentation[0] - p.x; } } finally { gc.dispose(); } }
Example 12
Source File: XbaseInformationControl.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * Xbase - modification */ @Override public Point computeSizeConstraints(int widthInChars, int heightInChars) { if (fSymbolicFontName == null) return null; GC gc = new GC(fBrowser); Font font = JFaceResources.getFont(fSymbolicFontName); gc.setFont(font); int width = gc.getFontMetrics().getAverageCharWidth(); int height = gc.getFontMetrics().getHeight(); gc.dispose(); return new Point(widthInChars * width, heightInChars * height); }
Example 13
Source File: TBSearchCellRenderer.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
/** * {@inheritDoc} */ public Point computeSize(GC gc, int wHint, int hHint, Object value) { GridItem item = (GridItem) value; gc.setFont(item.getFont(getColumn())); int x = 0; x += leftMargin; if (isTree()) { x += getToggleIndent(item); x += toggleRenderer.getBounds().width + insideMargin; } if (isCheck()) { x += checkRenderer.getBounds().width + insideMargin; } int y = 0; Image image = item.getImage(getColumn()); if (image != null) { y = topMargin + image.getBounds().height + bottomMargin; x += image.getBounds().width + insideMargin; } // MOPR-DND // MOPR: replaced this code (to get correct preferred height for cells in word-wrap columns) // // x += gc.stringExtent(item.getText(column)).x + rightMargin; // // y = Math.max(y,topMargin + gc.getFontMetrics().getHeight() + bottomMargin); // // with this code: int textHeight = 0; if (!isWordWrap()) { x += gc.textExtent(item.getText(getColumn())).x + rightMargin; textHeight = topMargin + textTopMargin + gc.getFontMetrics().getHeight() + textBottomMargin + bottomMargin; } else { int plainTextWidth; if (wHint == SWT.DEFAULT) plainTextWidth = getBounds().width - x - rightMargin; else plainTextWidth = wHint - x - rightMargin; TextLayout currTextLayout = new TextLayout(gc.getDevice()); currTextLayout.setFont(gc.getFont()); currTextLayout.setText(item.getText(getColumn())); currTextLayout.setAlignment(getAlignment()); currTextLayout.setWidth(plainTextWidth < 1 ? 1 : plainTextWidth); x += plainTextWidth + rightMargin; textHeight += topMargin + textTopMargin; for (int cnt = 0; cnt < currTextLayout.getLineCount(); cnt++) textHeight += currTextLayout.getLineBounds(cnt).height; textHeight += textBottomMargin + bottomMargin; currTextLayout.dispose(); } y = Math.max(y, textHeight); return new Point(x, y); }
Example 14
Source File: DefaultColumnHeaderRenderer.java From nebula with Eclipse Public License 2.0 | 4 votes |
/** * {@inheritDoc} */ public Point computeSize(GC gc, int wHint, int hHint, Object value) { GridColumn column = (GridColumn)value; gc.setFont(column.getHeaderFont()); int x = leftMargin; int y = topMargin + gc.getFontMetrics().getHeight() + bottomMargin; if (column.getImage() != null) { x += column.getImage().getBounds().width + imageSpacing; y = Math.max(y, topMargin + column.getImage().getBounds().height + bottomMargin); } if (!isWordWrap()) { x += gc.stringExtent(column.getText()).x + rightMargin; } else { int plainTextWidth; if (wHint == SWT.DEFAULT) plainTextWidth = getBounds().width - x - rightMargin; else plainTextWidth = wHint - x - rightMargin; getTextLayout(gc, column); textLayout.setText(column.getText()); textLayout.setWidth(plainTextWidth < 1 ? 1 : plainTextWidth); x += plainTextWidth + rightMargin; int textHeight = topMargin; textHeight += textLayout.getBounds().height; textHeight += bottomMargin; y = Math.max(y, textHeight); } y += computeControlSize(column).y; return new Point(x, y); }
Example 15
Source File: CellRenderer.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * {@inheritDoc} */ public Point computeSize(GC gc, int wHint, int hHint, Object value) { GridItem item = (GridItem) value; gc.setFont(item.getFont(getColumn())); int x = 0; x += leftMargin; if (isTree()) { x += getToggleIndent(item); x += toggleRenderer.getBounds().width + insideMargin; } if (isCheck()) { x += checkRenderer.getBounds().width + insideMargin; } int y = 0; Image image = item.getImage(getColumn()); if (image != null) { y = topMargin + image.getBounds().height + bottomMargin; x += image.getBounds().width + insideMargin; } // MOPR-DND // MOPR: replaced this code (to get correct preferred height for cells // in word-wrap columns) // // x += gc.stringExtent(item.getText(column)).x + rightMargin; // // y = Math.max(y,topMargin + gc.getFontMetrics().getHeight() + // bottomMargin); // // with this code: int textHeight = 0; if (!isWordWrap()) { x += gc.textExtent(item.getText(getColumn())).x + rightMargin; textHeight = topMargin + textTopMargin + gc.getFontMetrics().getHeight() + textBottomMargin + bottomMargin; } else { int plainTextWidth; if (wHint == SWT.DEFAULT) plainTextWidth = getBounds().width - x - rightMargin; else plainTextWidth = wHint - x - rightMargin; TextLayout currTextLayout = new TextLayout(gc.getDevice()); currTextLayout.setFont(gc.getFont()); currTextLayout.setText(item.getText(getColumn())); currTextLayout.setAlignment(getAlignment()); currTextLayout.setWidth(plainTextWidth < 1 ? 1 : plainTextWidth); x += plainTextWidth + rightMargin; textHeight += topMargin + textTopMargin; for (int cnt = 0; cnt < currTextLayout.getLineCount(); cnt++) textHeight += currTextLayout.getLineBounds(cnt).height; textHeight += textBottomMargin + bottomMargin; currTextLayout.dispose(); } y = Math.max(y, textHeight); return new Point(x, y); }
Example 16
Source File: SourceColunmCellRenderer.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * {@inheritDoc} */ public Point computeSize(GC gc, int wHint, int hHint, Object value) { GridItem item = (GridItem) value; gc.setFont(item.getFont(getColumn())); int x = 0; x += leftMargin; int y = 0; Image image = item.getImage(getColumn()); if (image != null) { y = topMargin + image.getBounds().height + bottomMargin; } // MOPR-DND // MOPR: replaced this code (to get correct preferred height for cells in word-wrap columns) // // x += gc.stringExtent(item.getText(column)).x + rightMargin; // // y = Math.max(y,topMargin + gc.getFontMetrics().getHeight() + bottomMargin); // // with this code: int textHeight = 0; if (!isWordWrap()) { x += gc.textExtent(item.getText(getColumn())).x + rightMargin; textHeight = topMargin + textTopMargin + gc.getFontMetrics().getHeight() + textBottomMargin + bottomMargin; } else { int plainTextWidth; if (wHint == SWT.DEFAULT) plainTextWidth = getBounds().width - x - rightMargin; else plainTextWidth = wHint - x - rightMargin; TextLayout currTextLayout = new TextLayout(gc.getDevice()); currTextLayout.setFont(gc.getFont()); currTextLayout.setText(item.getText(getColumn())); currTextLayout.setAlignment(getAlignment()); currTextLayout.setWidth(plainTextWidth < 1 ? 1 : plainTextWidth); x += plainTextWidth + rightMargin; textHeight += topMargin + textTopMargin; for (int cnt = 0; cnt < currTextLayout.getLineCount(); cnt++) textHeight += currTextLayout.getLineBounds(cnt).height; textHeight += textBottomMargin + bottomMargin; currTextLayout.dispose(); } y = Math.max(y, textHeight); return new Point(x, y); }
Example 17
Source File: DefaultColumnHeaderRenderer.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * {@inheritDoc} */ public Point computeSize(GC gc, int wHint, int hHint, Object value) { GridColumn column = (GridColumn)value; gc.setFont(column.getHeaderFont()); int x = leftMargin; int y = topMargin + gc.getFontMetrics().getHeight() + bottomMargin; if (column.getImage() != null) { x += column.getImage().getBounds().width + imageSpacing; y = Math.max(y, topMargin + column.getImage().getBounds().height + bottomMargin); } if (!isWordWrap()) { x += gc.stringExtent(column.getText()).x + rightMargin; } else { int plainTextWidth; if (wHint == SWT.DEFAULT) plainTextWidth = getBounds().width - x - rightMargin; else plainTextWidth = wHint - x - rightMargin; getTextLayout(gc, column); textLayout.setText(column.getText()); textLayout.setWidth(plainTextWidth < 1 ? 1 : plainTextWidth); x += plainTextWidth + rightMargin; int textHeight = topMargin; textHeight += textLayout.getBounds().height; textHeight += bottomMargin; y = Math.max(y, textHeight); } y += computeControlSize(column).y; return new Point(x, y); }
Example 18
Source File: BoldPaintInstruction.java From nebula with Eclipse Public License 2.0 | 4 votes |
@Override public void paint(GC gc, Rectangle area) { Font currentFont = gc.getFont(); this.state.addPreviousFont(currentFont); gc.setFont(ResourceHelper.getBoldFont(currentFont)); }
Example 19
Source File: SwtChartViewerSelector.java From birt with Eclipse Public License 1.0 | 4 votes |
private final void showException( GC g2d, Exception ex ) { String sWrappedException = ex.getClass( ).getName( ); Throwable th = ex; while ( ex.getCause( ) != null ) { ex = (Exception) ex.getCause( ); } String sException = ex.getClass( ).getName( ); if ( sWrappedException.equals( sException ) ) { sWrappedException = null; } String sMessage = null; if ( th instanceof BirtException ) { sMessage = ( (BirtException) th ).getLocalizedMessage( ); } else { sMessage = ex.getMessage( ); } if ( sMessage == null ) { sMessage = "<null>";//$NON-NLS-1$ } StackTraceElement[] stea = ex.getStackTrace( ); Point d = this.getSize( ); Device dv = Display.getCurrent( ); Font fo = new Font( dv, "Courier", SWT.BOLD, 16 );//$NON-NLS-1$ g2d.setFont( fo ); FontMetrics fm = g2d.getFontMetrics( ); g2d.setBackground( dv.getSystemColor( SWT.COLOR_WHITE ) ); g2d.fillRectangle( 20, 20, d.x - 40, d.y - 40 ); g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); g2d.drawRectangle( 20, 20, d.x - 40, d.y - 40 ); g2d.setClipping( 20, 20, d.x - 40, d.y - 40 ); int x = 25, y = 20 + fm.getHeight( ); g2d.drawString( "Exception:", x, y );//$NON-NLS-1$ x += g2d.textExtent( "Exception:" ).x + 5;//$NON-NLS-1$ g2d.setForeground( dv.getSystemColor( SWT.COLOR_RED ) ); g2d.drawString( sException, x, y ); x = 25; y += fm.getHeight( ); if ( sWrappedException != null ) { g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); g2d.drawString( "Wrapped In:", x, y );//$NON-NLS-1$ x += g2d.textExtent( "Wrapped In:" ).x + 5;//$NON-NLS-1$ g2d.setForeground( dv.getSystemColor( SWT.COLOR_RED ) ); g2d.drawString( sWrappedException, x, y ); x = 25; y += fm.getHeight( ); } g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); y += 10; g2d.drawString( "Message:", x, y );//$NON-NLS-1$ x += g2d.textExtent( "Message:" ).x + 5;//$NON-NLS-1$ g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLUE ) ); g2d.drawString( sMessage, x, y ); x = 25; y += fm.getHeight( ); g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); y += 10; g2d.drawString( "Trace:", x, y );//$NON-NLS-1$ x = 40; y += fm.getHeight( ); g2d.setForeground( dv.getSystemColor( SWT.COLOR_DARK_GREEN ) ); for ( int i = 0; i < stea.length; i++ ) { g2d.drawString( stea[i].getClassName( ) + ":"//$NON-NLS-1$ + stea[i].getMethodName( ) + "(...):"//$NON-NLS-1$ + stea[i].getLineNumber( ), x, y ); x = 40; y += fm.getHeight( ); } fo.dispose( ); }
Example 20
Source File: JavaViewer.java From birt with Eclipse Public License 1.0 | 4 votes |
private final void showException( GC g2d, Exception ex ) { String sWrappedException = ex.getClass( ).getName( ); Throwable th = ex; while ( ex.getCause( ) != null ) { ex = (Exception) ex.getCause( ); } String sException = ex.getClass( ).getName( ); if ( sWrappedException.equals( sException ) ) { sWrappedException = null; } String sMessage = null; if ( th instanceof BirtException ) { sMessage = ( (BirtException) th ).getLocalizedMessage( ); } else { sMessage = ex.getMessage( ); } if ( sMessage == null ) { sMessage = "<null>";//$NON-NLS-1$ } StackTraceElement[] stea = ex.getStackTrace( ); Point d = this.getSize( ); Device dv = Display.getCurrent( ); Font fo = new Font( dv, "Courier", SWT.BOLD, 16 );//$NON-NLS-1$ g2d.setFont( fo ); FontMetrics fm = g2d.getFontMetrics( ); g2d.setBackground( dv.getSystemColor( SWT.COLOR_WHITE ) ); g2d.fillRectangle( 20, 20, d.x - 40, d.y - 40 ); g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); g2d.drawRectangle( 20, 20, d.x - 40, d.y - 40 ); g2d.setClipping( 20, 20, d.x - 40, d.y - 40 ); int x = 25, y = 20 + fm.getHeight( ); g2d.drawString( "Exception:", x, y );//$NON-NLS-1$ x += g2d.textExtent( "Exception:" ).x + 5;//$NON-NLS-1$ g2d.setForeground( dv.getSystemColor( SWT.COLOR_RED ) ); g2d.drawString( sException, x, y ); x = 25; y += fm.getHeight( ); if ( sWrappedException != null ) { g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); g2d.drawString( "Wrapped In:", x, y );//$NON-NLS-1$ x += g2d.textExtent( "Wrapped In:" ).x + 5;//$NON-NLS-1$ g2d.setForeground( dv.getSystemColor( SWT.COLOR_RED ) ); g2d.drawString( sWrappedException, x, y ); x = 25; y += fm.getHeight( ); } g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); y += 10; g2d.drawString( "Message:", x, y );//$NON-NLS-1$ x += g2d.textExtent( "Message:" ).x + 5;//$NON-NLS-1$ g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLUE ) ); g2d.drawString( sMessage, x, y ); x = 25; y += fm.getHeight( ); g2d.setForeground( dv.getSystemColor( SWT.COLOR_BLACK ) ); y += 10; g2d.drawString( "Trace:", x, y );//$NON-NLS-1$ x = 40; y += fm.getHeight( ); g2d.setForeground( dv.getSystemColor( SWT.COLOR_DARK_GREEN ) ); for ( int i = 0; i < stea.length; i++ ) { g2d.drawString( stea[i].getClassName( ) + ":"//$NON-NLS-1$ + stea[i].getMethodName( ) + "(...):"//$NON-NLS-1$ + stea[i].getLineNumber( ), x, y ); x = 40; y += fm.getHeight( ); } fo.dispose( ); }