Here you can find the source of drawWinUpperLeft(Graphics g, int which, Color fill, int x, int y, int fmWidth, int fmHeight)
public static void drawWinUpperLeft(Graphics g, int which, Color fill, int x, int y, int fmWidth, int fmHeight)
//package com.java2s; /**/*from w w w . j av a2s . co m*/ * Title: tn5250J * Copyright: Copyright (c) 2001,202,2003 * Company: * @author Kenneth J. Pouncey * @version 0.4 * * Description: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * */ import java.awt.Color; import java.awt.Graphics; public class Main { public static final int WINDOW_NORMAL = 3; public static final int WINDOW_GRAPHIC = 4; public static void drawWinUpperLeft(Graphics g, int which, Color fill, int x, int y, int fmWidth, int fmHeight) { Color oldColor = g.getColor(); // make sure we leave it as we found it // g.translate(x, y); g.setColor(fill); if (which == WINDOW_GRAPHIC) { g.fillRect(x, y, fmWidth, fmHeight); g.setColor(Color.white); // -- horizontal g.drawLine(x, y, x + fmWidth, y); // | vertical g.drawLine(x, y, x, y + fmHeight); } if (which == WINDOW_NORMAL) { // -- horizontal g.drawLine(x + fmWidth / 2, y + fmHeight / 2, x + fmWidth, y + fmHeight / 2); // | vertical g.drawLine(x + fmWidth / 2, y + fmHeight / 2, x + fmWidth / 2, y + fmHeight); } // g.translate(-x, -y); g.setColor(oldColor); } }