类javax.swing.border.LineBorder源码实例Demo

下面列出了怎么用javax.swing.border.LineBorder的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: ContrastMetalTheme.java
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
源代码2 项目: dragonwell8_jdk   文件: TestSinhalaChar.java
private void run() {
    JFrame frame = new JFrame("Test Character (no crash = PASS)");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JLabel label = new JLabel("(empty)");
    label.setSize(400, 100);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(new Font("Lucida Bright", Font.PLAIN, 12));
    if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
       label.setText(Character.toString('\u0DDD'));
    } else {
    JButton button = new JButton("Set Char x0DDD");
    button.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
       label.setText(Character.toString('\u0DDD'));
        }
    });
    panel.add(button);
    }
    panel.add(label);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
源代码3 项目: ghidra   文件: FcgVertex.java
private void buildUi() {

		createPaints();

		// init the components
		String truncated = StringUtilities.trimMiddle(getName(), MAX_NAME_LENGTH);
		nameLabel.setText(truncated);
		buildVertexShape();

		// calculate the needed size
		layeredPane = new JLayeredPane();
		Border border = createDebugBorder(new LineBorder(Color.YELLOW.darker(), 1));
		layeredPane.setBorder(border);

		updateLayeredPaneSize();

		// layout the components
		addVertexShape();
		addToggleButtons();
		addNameLabel();

		buildFullShape();
	}
 
源代码4 项目: arcusplatform   文件: CapabilityTableCellEditor.java
@Override
public boolean stopCellEditing() {
   if(current == null) {
      return true;
   }
   try {
      boolean stopped = current.stopCellEditing();
      if(stopped) {
         current = null;
      }
      return stopped;
   }
   catch(Exception e) {
      JComponent c = (JComponent) getComponent();
      c.setBorder(new LineBorder(Color.RED));
      Oculus.warn("Invalid value for cell: " + e.getMessage() + "\nClick 'esc' to stop editing", e);
      return false;
   }
}
 
源代码5 项目: TencentKona-8   文件: ContrastMetalTheme.java
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
源代码6 项目: TencentKona-8   文件: TestSinhalaChar.java
private void run() {
    JFrame frame = new JFrame("Test Character (no crash = PASS)");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JLabel label = new JLabel("(empty)");
    label.setSize(400, 100);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(new Font("Lucida Bright", Font.PLAIN, 12));
    if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
       label.setText(Character.toString('\u0DDD'));
    } else {
    JButton button = new JButton("Set Char x0DDD");
    button.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
       label.setText(Character.toString('\u0DDD'));
        }
    });
    panel.add(button);
    }
    panel.add(label);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
源代码7 项目: jdk8u60   文件: ContrastMetalTheme.java
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
源代码8 项目: jdk8u60   文件: TestSinhalaChar.java
private void run() {
    JFrame frame = new JFrame("Test Character (no crash = PASS)");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JLabel label = new JLabel("(empty)");
    label.setSize(400, 100);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(new Font("Lucida Bright", Font.PLAIN, 12));
    if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
       label.setText(Character.toString('\u0DDD'));
    } else {
    JButton button = new JButton("Set Char x0DDD");
    button.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
       label.setText(Character.toString('\u0DDD'));
        }
    });
    panel.add(button);
    }
    panel.add(label);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
源代码9 项目: nanoleaf-desktop   文件: Main.java
private void initWindow() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT);
    if (getUserWindowWidth() != DEFAULT_WINDOW_WIDTH ||
            getUserWindowHeight() != DEFAULT_WINDOW_HEIGHT) {
        setSize(getUserWindowWidth(), getUserWindowHeight());
    }
    setUndecorated(true);
    URL iconPath = getClass().getResource("/images/icon.png");
    ImageIcon imageIcon = new ImageIcon(iconPath);
    Image image = imageIcon.getImage();
    setIconImage(image);

    contentPane = new JPanel();
    contentPane.setBackground(Color.DARK_GRAY);
    contentPane.setBorder(new LineBorder(new Color(128, 128, 128), 3, true));
    setContentPane(contentPane);
    contentPane.setLayout(new MigLayout("", "[-27.00,grow][755.00,grow]",
                                        "[][120px:120px,grow][300px:400px,grow][100px:400px,grow]"));
}
 
源代码10 项目: nanoleaf-desktop   文件: SingleEntryDialog.java
public SingleEntryDialog(Component parent, String entryLabel,
		String buttonLabel, ActionListener buttonListener)
{
	super();
	
	entry = new JTextField(entryLabel);
	entry.setForeground(Color.WHITE);
	entry.setBackground(Color.DARK_GRAY);
	entry.setBorder(new LineBorder(Color.GRAY));
	entry.setCaretColor(Color.WHITE);
	entry.setFont(new Font("Tahoma", Font.PLAIN, 22));
	entry.addFocusListener(new TextFieldFocusListener(entry));
	contentPanel.add(entry, "cell 0 1, grow, gapx 2 2");
	
	JButton btnConfirm = new ModernButton(buttonLabel);
	btnConfirm.setFont(new Font("Tahoma", Font.PLAIN, 18));
	btnConfirm.addActionListener(buttonListener);
	contentPanel.add(btnConfirm, "cell 0 3, alignx center");
	
	JLabel spacer = new JLabel(" ");
	contentPanel.add(spacer, "cell 0 4");
	
	finalize(parent);
	
	btnConfirm.requestFocus();
}
 
源代码11 项目: nanoleaf-desktop   文件: BasicDialog.java
public BasicDialog()
{
	setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	setUndecorated(true);
	contentPanel.setLayout(new MigLayout("", "[432.00,grow]", "[][]"));
	contentPanel.setBackground(Color.DARK_GRAY);
	contentPanel.setBorder(new LineBorder(new Color(128, 128, 128), 2));
	setContentPane(contentPanel);
	
	WindowDragListener wdl = new WindowDragListener(50);
	addMouseListener(wdl);
	addMouseMotionListener(wdl);
	
	CloseButton btnClose = new CloseButton(this, JFrame.DISPOSE_ON_CLOSE);
	contentPanel.add(btnClose, "cell 0 0,alignx right,gapx 0 15");
}
 
源代码12 项目: aion-germany   文件: ProtocolTab.java
public PartRowPanel(PartType type) {
	_type = type;
	_typeCombo = new PartTypeComboBox();
	_typeCombo.setSelectedItem(_type.getName());
	JButton addButton = new JButton(IconsTable.ICON_PLUS);
	addButton.setActionCommand("+id");
	addButton.addActionListener(new PacketEditorActionListener());
	JButton delButton = new JButton(IconsTable.ICON_MINUS);
	delButton.setActionCommand("-id");
	delButton.addActionListener(new PacketEditorActionListener());
	this.add(_typeCombo);
	this.add(addButton);
	this.add(delButton);
	this.setBackground(Color.CYAN);
	this.setBorder(new LineBorder(Color.BLACK));
}
 
源代码13 项目: JavaFX-Tutorial-Codes   文件: Main.java
private void addIcon(MaterialDesign icon) {
    JPanel panel = new JPanel();
    panel.setBackground(Color.decode("#FAFAFA"));
    panel.setBorder(new LineBorder(Color.GRAY));
    panel.setLayout(new GridLayout());
    panel.setSize(300, 300);

    FontIcon fontIcon = FontIcon.of(icon);
    fontIcon.setIconSize(150);
    fontIcon.setIconColor(Color.decode(getRandomColor()));

    JLabel label = new JLabel();
    label.setIcon(fontIcon);
    panel.add(label);
    root.add(panel);
}
 
源代码14 项目: Game   文件: PopupFrame.java
private void build() {
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	setUndecorated(true);
	setPreferredSize(new Dimension(300, 150));
	setLayout(null);
	setResizable(false);

	getContentPane().setBackground(new Color(30, 30, 30));
	getRootPane().setBorder(new LineBorder(new Color(0, 0, 0), 1));

	msg = new JLabel(message);
	msg.setForeground(Color.WHITE);
	msg.setHorizontalAlignment(0);
	msg.setBounds(0, 45, 300, 25);
	msg.setFont(Utils.getFont("Helvetica.otf", 0, 12.0F));
	add(msg);

	ControlButton close = new ControlButton(3, 110, 100, 75, 25);
	close.setText("Close");
	close.setFocusable(false);
	close.setForeground(Color.WHITE);
	close.addActionListener(arg0 -> setVisible(false));
	add(close);
	addMouseListener();
	pack();
}
 
源代码15 项目: openjdk-jdk8u   文件: ContrastMetalTheme.java
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
源代码16 项目: openjdk-jdk8u   文件: TestSinhalaChar.java
private void run() {
    JFrame frame = new JFrame("Test Character (no crash = PASS)");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JLabel label = new JLabel("(empty)");
    label.setSize(400, 100);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(new Font("Lucida Bright", Font.PLAIN, 12));
    if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
       label.setText(Character.toString('\u0DDD'));
    } else {
    JButton button = new JButton("Set Char x0DDD");
    button.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
       label.setText(Character.toString('\u0DDD'));
        }
    });
    panel.add(button);
    }
    panel.add(label);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
源代码17 项目: xyTalk-pc   文件: RoomMembersPanel.java
private void initComponents()
{
    setBorder(new LineBorder(Colors.LIGHT_GRAY));
    setBackground(Colors.FONT_WHITE);

    setPreferredSize(new Dimension(ROOM_MEMBER_PANEL_WIDTH, MainFrame.getContext().currentWindowHeight));
    setVisible(false);
    listView.setScrollBarColor(Colors.SCROLL_BAR_THUMB, Colors.WINDOW_BACKGROUND);
    listView.setContentPanelBackground(Colors.FONT_WHITE);
    listView.getContentPanel().setBackground(Colors.FONT_WHITE);

    operationPanel.setPreferredSize(new Dimension(60, 80));
    operationPanel.setBackground(Colors.FONT_WHITE);


    leaveButton = new RCButton("退出群聊", Colors.WINDOW_BACKGROUND_LIGHT, Colors.WINDOW_BACKGROUND, Colors.SCROLL_BAR_TRACK_LIGHT);
    leaveButton.setForeground(Colors.RED);
    leaveButton.setPreferredSize(new Dimension(180, 30));

}
 
源代码18 项目: xyTalk-pc   文件: FileEditorThumbnail.java
private void initComponents()
{
    setPreferredSize(new Dimension(100, 70));
    setMaximumSize(new Dimension(100, 70));
    setBackground(Colors.FONT_WHITE);
    setBorder(new LineBorder(Colors.LIGHT_GRAY));

    icon = new JLabel();
    icon.setHorizontalAlignment(SwingConstants.CENTER);
    ImageIcon imageIcon = attachmentIconHelper.getImageIcon(path, 35, 35);
    icon.setIcon(imageIcon);


    text = new JLabel();
    text.setFont(FontUtil.getDefaultFont(12));
    text.setText(path.substring(path.lastIndexOf(File.separator) + 1));
    text.setHorizontalAlignment(SwingConstants.CENTER);
}
 
源代码19 项目: views-widgets-samples   文件: AnimationPanel.java
AnimationPanel(CycleSetModel cycleModel, JButton play) {
  super(new FlowLayout(FlowLayout.LEFT));
  setBackground(new Color(0xF8F8F4));
  setBorder(new  LineBorder(new Color(0x888888),1));
  myCycleModel = cycleModel;
  myPlayButton = play;
  myPlayButton.addActionListener(e -> play());
}
 
源代码20 项目: dragonwell8_jdk   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
源代码21 项目: dragonwell8_jdk   文件: TestOldHangul.java
private void run()  {
    Font ourFont = null;
    final String fontName = "UnBatangOdal.ttf";  // download from http://chem.skku.ac.kr/~wkpark/project/font/GSUB/UnbatangOdal/  and place in {user.home}/fonts/
    try {
        ourFont = Font.createFont(Font.TRUETYPE_FONT, new java.io.File(new java.io.File(System.getProperty("user.home"),"fonts"), fontName));
        ourFont = ourFont.deriveFont((float)48.0);
    } catch(Throwable t) {
        t.printStackTrace();
        System.err.println("Fail: " + t);
        return;
    }
    JFrame frame = new JFrame(System.getProperty("java.version"));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JTextArea label = new JTextArea("(empty)");
    label.setSize(400, 300);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(ourFont);
    final String str = "\u110A\u119E\u11B7\u0020\u1112\u119E\u11AB\uAE00\u0020\u1100\u119E\u11F9\u0020\u112B\u119E\u11BC\n";

    if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
        label.setText(str);
    } else {
    JButton button = new JButton("Old Hangul");
    button.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
            label.setText(str);
        }
    });
    panel.add(button);
    }
    panel.add(label);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
源代码22 项目: ghidra   文件: FcgVertex.java
private void buildVertexShape() {
	int w = VERTEX_SHAPE_SIZE;
	int h = VERTEX_SHAPE_SIZE;
	Double circle = new Ellipse2D.Double(0, 0, w, h);

	BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
	Graphics2D g2 = (Graphics2D) image.getGraphics();
	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

	FcgDirection direction = level.getDirection();
	if (direction.isSource()) {
		g2.setColor(getVertexShapeColor());
	}
	else if (direction.isIn()) {
		g2.setPaint(inPaint);
	}
	else {
		g2.setPaint(outPaint);
	}

	g2.fill(circle);

	g2.dispose();

	vertexShape = circle;
	compactShape = (Double) vertexShape.clone();
	vertexImageLabel.setIcon(new ImageIcon(image));

	Border border = createDebugBorder(new LineBorder(Color.PINK, 1));
	vertexImageLabel.setBorder(border);
}
 
源代码23 项目: ghidra   文件: FcgVertex.java
private void addNameLabel() {

		Border border = createDebugBorder(new LineBorder(Color.GREEN, 1));
		nameLabel.setBorder(border);

		// assume the vertex label has been bounded
		Rectangle parentBounds = vertexImageLabel.getBounds();
		Dimension size = nameLabel.getPreferredSize();

		// bottom, centered under the shape
		int x = (parentBounds.x + (parentBounds.width / 2)) - (size.width / 2);
		int y = parentBounds.y + parentBounds.height + GAP;
		nameLabel.setBounds(x, y, size.width, size.height);
		layeredPane.add(nameLabel, LABEL_LAYER);
	}
 
源代码24 项目: arcusplatform   文件: Table.java
@Override
public boolean stopCellEditing() {
   try {
      return super.stopCellEditing();
   }
   catch(Exception e) {
      JComponent c = (JComponent) getComponent();
      c.setBorder(new LineBorder(Color.RED));
      Oculus.warn("Invalid value for cell: " + e.getMessage() + "\nClick 'esc' to stop editing", e);
      return false;
   }
}
 
源代码25 项目: TencentKona-8   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
源代码26 项目: TencentKona-8   文件: TestOldHangul.java
private void run()  {
    Font ourFont = null;
    final String fontName = "UnBatangOdal.ttf";  // download from http://chem.skku.ac.kr/~wkpark/project/font/GSUB/UnbatangOdal/  and place in {user.home}/fonts/
    try {
        ourFont = Font.createFont(Font.TRUETYPE_FONT, new java.io.File(new java.io.File(System.getProperty("user.home"),"fonts"), fontName));
        ourFont = ourFont.deriveFont((float)48.0);
    } catch(Throwable t) {
        t.printStackTrace();
        System.err.println("Fail: " + t);
        return;
    }
    JFrame frame = new JFrame(System.getProperty("java.version"));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JTextArea label = new JTextArea("(empty)");
    label.setSize(400, 300);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(ourFont);
    final String str = "\u110A\u119E\u11B7\u0020\u1112\u119E\u11AB\uAE00\u0020\u1100\u119E\u11F9\u0020\u112B\u119E\u11BC\n";

    if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
        label.setText(str);
    } else {
    JButton button = new JButton("Old Hangul");
    button.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
            label.setText(str);
        }
    });
    panel.add(button);
    }
    panel.add(label);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
源代码27 项目: jdk8u60   文件: CompositionArea.java
CompositionArea() {
    // create composition window with localized title
    String windowTitle = Toolkit.getProperty("AWT.CompositionWindowTitle", "Input Window");
    compositionWindow =
        (JFrame)InputMethodContext.createInputMethodWindow(windowTitle, null, true);

    setOpaque(true);
    setBorder(LineBorder.createGrayLineBorder());
    setForeground(Color.black);
    setBackground(Color.white);

    // if we get the focus, we still want to let the client's
    // input context handle the event
    enableInputMethods(true);
    enableEvents(AWTEvent.KEY_EVENT_MASK);

    compositionWindow.getContentPane().add(this);
    compositionWindow.addWindowListener(new FrameWindowAdapter());
    addInputMethodListener(this);
    compositionWindow.enableInputMethods(false);
    compositionWindow.pack();
    Dimension windowSize = compositionWindow.getSize();
    Dimension screenSize = (getToolkit()).getScreenSize();
    compositionWindow.setLocation(screenSize.width - windowSize.width-20,
                                screenSize.height - windowSize.height-100);
    compositionWindow.setVisible(false);
}
 
源代码28 项目: jdk8u60   文件: TestOldHangul.java
private void run()  {
    Font ourFont = null;
    final String fontName = "UnBatangOdal.ttf";  // download from http://chem.skku.ac.kr/~wkpark/project/font/GSUB/UnbatangOdal/  and place in {user.home}/fonts/
    try {
        ourFont = Font.createFont(Font.TRUETYPE_FONT, new java.io.File(new java.io.File(System.getProperty("user.home"),"fonts"), fontName));
        ourFont = ourFont.deriveFont((float)48.0);
    } catch(Throwable t) {
        t.printStackTrace();
        System.err.println("Fail: " + t);
        return;
    }
    JFrame frame = new JFrame(System.getProperty("java.version"));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JTextArea label = new JTextArea("(empty)");
    label.setSize(400, 300);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(ourFont);
    final String str = "\u110A\u119E\u11B7\u0020\u1112\u119E\u11AB\uAE00\u0020\u1100\u119E\u11F9\u0020\u112B\u119E\u11BC\n";

    if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
        label.setText(str);
    } else {
    JButton button = new JButton("Old Hangul");
    button.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
            label.setText(str);
        }
    });
    panel.add(button);
    }
    panel.add(label);

    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
源代码29 项目: nanoleaf-desktop   文件: Main.java
private void initPanelCanvas() {
    canvas = new PanelCanvas(devices);
    canvas.setLayout(new GridBagLayout());
    canvas.setBorder(new TitledBorder(new LineBorder(Color.GRAY),
                                      "Preview", TitledBorder.LEFT, TitledBorder.TOP, null, Color.WHITE));
    ((javax.swing.border.TitledBorder) canvas.getBorder())
            .setTitleFont(new Font("Tahoma", Font.BOLD, 22));
    contentPane.add(canvas, "cell 1 1 1 2,grow");
}
 
源代码30 项目: nanoleaf-desktop   文件: DiscoveryCellRenderer.java
public DiscoveryCellRenderer()
{
	setOpaque(true);
	setBorder(new CompoundBorder(
			new LineBorder(java.awt.Color.GRAY, 1),
			new EmptyBorder(0, 0, 10, 0)));
	setVerticalTextPosition(JLabel.BOTTOM);
	setHorizontalTextPosition(JLabel.CENTER);
	setIconTextGap(10);
	setFont(new Font("Tahoma", Font.PLAIN, 22));
	setForeground(java.awt.Color.WHITE);
}
 
 类所在包
 类方法
 同包方法