当前位置: 首页>>代码示例>>Java>>正文


Java TextArea.setFont方法代码示例

本文整理汇总了Java中java.awt.TextArea.setFont方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setFont方法的具体用法?Java TextArea.setFont怎么用?Java TextArea.setFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.TextArea的用法示例。


在下文中一共展示了TextArea.setFont方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initGUI

import java.awt.TextArea; //导入方法依赖的package包/类
private void initGUI() {

        Panel pQuery   = new Panel();
        Panel pCommand = new Panel();

        pResult = new Panel();

        pQuery.setLayout(new BorderLayout());
        pCommand.setLayout(new BorderLayout());
        pResult.setLayout(new BorderLayout());

        Font fFont = new Font("Dialog", Font.PLAIN, 12);

        txtCommand = new TextArea(5, 40);

        txtCommand.addKeyListener(this);

        txtResult = new TextArea(20, 40);

        txtCommand.setFont(fFont);
        txtResult.setFont(new Font("Courier", Font.PLAIN, 12));

        butExecute = new Button("Execute");
        butClear   = new Button("Clear");

        butExecute.addActionListener(this);
        butClear.addActionListener(this);
        pCommand.add("East", butExecute);
        pCommand.add("West", butClear);
        pCommand.add("Center", txtCommand);

        gResult = new Grid();

        setLayout(new BorderLayout());
        pResult.add("Center", gResult);
        pQuery.add("North", pCommand);
        pQuery.add("Center", pResult);
        fMain.add("Center", pQuery);

        tTree = new Tree();

        // (ulrivo): screen with less than 640 width
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

        if (d.width >= 640) {
            tTree.setMinimumSize(new Dimension(200, 100));
        } else {
            tTree.setMinimumSize(new Dimension(80, 100));
        }

        gResult.setMinimumSize(new Dimension(200, 300));
        fMain.add("West", tTree);
        doLayout();
        fMain.pack();
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:56,代码来源:DatabaseManager.java

示例2: initGUI

import java.awt.TextArea; //导入方法依赖的package包/类
/**
 * Method declaration
 *
 */
private void initGUI() {

    Panel pQuery   = new Panel();
    Panel pCommand = new Panel();

    // define a Panel pCard which takes four different cards/views:
    // tree of tables, command SQL text area, result window and an editor/input form
    pCard      = new Panel();
    layoutCard = new CardLayout(2, 2);

    pCard.setLayout(layoutCard);

    // four buttons at the top to quickly switch between the four views
    butTree    = new Button("Tree");
    butCommand = new Button("Command");
    butResult  = new Button("Result");
    butEditor  = new Button("Editor");

    butTree.addActionListener(this);
    butCommand.addActionListener(this);
    butResult.addActionListener(this);
    butEditor.addActionListener(this);

    Panel pButtons = new Panel();

    pButtons.setLayout(new GridLayout(1, 4, 8, 8));
    pButtons.add(butTree);
    pButtons.add(butCommand);
    pButtons.add(butResult);
    pButtons.add(butEditor);

    pResult = new Panel();

    pQuery.setLayout(new BorderLayout());
    pCommand.setLayout(new BorderLayout());
    pResult.setLayout(new BorderLayout());

    Font fFont = new Font("Dialog", Font.PLAIN, 12);

    txtCommand = new TextArea(5, 40);

    txtCommand.addKeyListener(this);

    txtResult = new TextArea(20, 40);

    txtCommand.setFont(fFont);
    txtResult.setFont(new Font("Courier", Font.PLAIN, 12));

    butExecute = new Button("Execute");

    butExecute.addActionListener(this);
    pCommand.add("South", butExecute);
    pCommand.add("Center", txtCommand);

    gResult = new Grid();

    setLayout(new BorderLayout());
    pResult.add("Center", gResult);

    tTree = new Tree();

    tTree.setMinimumSize(new Dimension(200, 100));
    gResult.setMinimumSize(new Dimension(200, 300));

    eEditor = new ZaurusEditor();

    pCard.add("tree", tTree);
    pCard.add("command", pCommand);
    pCard.add("result", pResult);
    pCard.add("editor", eEditor);
    fMain.add("Center", pCard);
    fMain.add("North", pButtons);
    doLayout();
    fMain.pack();
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:80,代码来源:ZaurusDatabaseManager.java

示例3: initGUI

import java.awt.TextArea; //导入方法依赖的package包/类
/**
 * Method declaration
 *
 */
private void initGUI() {

    Panel pQuery   = new Panel();
    Panel pCommand = new Panel();

    pResult = new Panel();

    pQuery.setLayout(new BorderLayout());
    pCommand.setLayout(new BorderLayout());
    pResult.setLayout(new BorderLayout());

    Font fFont = new Font("Dialog", Font.PLAIN, 12);

    txtCommand = new TextArea(5, 40);

    txtCommand.addKeyListener(this);

    txtResult = new TextArea(20, 40);

    txtCommand.setFont(fFont);
    txtResult.setFont(new Font("Courier", Font.PLAIN, 12));

    butExecute = new Button("Execute");
    butClear   = new Button("Clear");

    butExecute.addActionListener(this);
    butClear.addActionListener(this);
    pCommand.add("East", butExecute);
    pCommand.add("West", butClear);
    pCommand.add("Center", txtCommand);

    gResult = new Grid();

    setLayout(new BorderLayout());
    pResult.add("Center", gResult);
    pQuery.add("North", pCommand);
    pQuery.add("Center", pResult);
    fMain.add("Center", pQuery);

    tTree = new Tree();

    // (ulrivo): screen with less than 640 width
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

    if (d.width >= 640) {
        tTree.setMinimumSize(new Dimension(200, 100));
    } else {
        tTree.setMinimumSize(new Dimension(80, 100));
    }

    gResult.setMinimumSize(new Dimension(200, 300));
    fMain.add("West", tTree);
    doLayout();
    fMain.pack();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:60,代码来源:DatabaseManager.java

示例4: initGUI

import java.awt.TextArea; //导入方法依赖的package包/类
/**
 * Create the graphical user interface. This is AWT code.
 */
private void initGUI() {

    // all panels
    Panel pQuery       = new Panel();
    Panel pCommand     = new Panel();
    Panel pButton      = new Panel();
    Panel pRecent      = new Panel();
    Panel pResult      = new Panel();
    Panel pBorderWest  = new Panel();
    Panel pBorderEast  = new Panel();
    Panel pBorderSouth = new Panel();

    pQuery.setLayout(new BorderLayout());
    pCommand.setLayout(new BorderLayout());
    pButton.setLayout(new BorderLayout());
    pRecent.setLayout(new BorderLayout());
    pResult.setLayout(new BorderLayout());
    pBorderWest.setBackground(SystemColor.control);
    pBorderSouth.setBackground(SystemColor.control);
    pBorderEast.setBackground(SystemColor.control);

    // labels
    Label lblCommand = new Label(" Command", Label.LEFT);
    Label lblRecent  = new Label(" Recent", Label.LEFT);
    Label lblResult  = new Label(" Result", Label.LEFT);

    lblCommand.setBackground(SystemColor.control);
    lblRecent.setBackground(SystemColor.control);
    lblResult.setBackground(SystemColor.control);

    // buttons
    butExecute = new Button("Execute");
    butScript  = new Button("Script");
    butImport  = new Button("Import");

    pButton.add("South", butScript);
    pButton.add("Center", butExecute);
    pButton.add("North", butImport);

    // command - textarea
    Font fFont = new Font("Dialog", Font.PLAIN, 12);

    txtCommand = new TextArea(5, 40);

    txtCommand.setFont(fFont);

    // recent - choice
    choRecent = new Choice();

    // result - grid
    gResult = new Grid();

    // combine it
    setLayout(new BorderLayout());
    pRecent.add("Center", choRecent);
    pRecent.add("North", lblRecent);
    pCommand.add("North", lblCommand);
    pCommand.add("East", pButton);
    pCommand.add("Center", txtCommand);
    pCommand.add("South", pRecent);
    pResult.add("North", lblResult);
    pResult.add("Center", gResult);
    pQuery.add("North", pCommand);
    pQuery.add("Center", pResult);
    add("Center", pQuery);
    add("West", pBorderWest);
    add("East", pBorderEast);
    add("South", pBorderSouth);

    // [email protected] 20011210 - patch 450412 by [email protected]
    doLayout();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:76,代码来源:QueryTool.java


注:本文中的java.awt.TextArea.setFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。