Example usage for java.awt Label CENTER

List of usage examples for java.awt Label CENTER

Introduction

In this page you can find the example usage for java.awt Label CENTER.

Prototype

int CENTER

To view the source code for java.awt Label CENTER.

Click Source Link

Document

Indicates that the label should be centered.

Usage

From source file:CircleOfSquares.java

MethodAreaPanel(int methodAreaMemorySectionSize) {

    memoryView = new MemoryViewWithTitles(methodAreaMemorySectionSize);
    setLayout(new BorderLayout());

    title = new Label("Method Area", Label.CENTER);
    title.setFont(new Font("Helvetica", Font.BOLD, 11));

    add("North", title);
    add("Center", memoryView);
}

From source file:JVMSimulator.java

ControlPanel() {

    setLayout(new BorderLayout(5, 5));

    Panel leftButtonPanel = new Panel();
    leftButtonPanel.setLayout(new GridLayout(2, 2, 5, 5));
    leftButtonPanel.add(stepButton);/*  w  w w .j av a2 s .c o m*/
    resetButton.disable();
    leftButtonPanel.add(runButton);
    leftButtonPanel.add(resetButton);
    leftButtonPanel.add(stopButton);
    stopButton.disable();
    explanationLabel = new ColoredLabel("This is where the explanation goes...", Label.CENTER, Color.lightGray);

    explanationLabel.setBackground(SimData.explanationLabel);
    Font plainFont = new Font("TimesRoman", Font.ITALIC, 12);
    explanationLabel.setFont(plainFont);

    add("West", leftButtonPanel);
    add("Center", explanationLabel);
}

From source file:CircleOfSquares.java

RegisterPanel() {

    setLayout(new BorderLayout(5, 5));

    pcRegister = new LabeledRegister(StringTable.pc);
    optopRegister = new LabeledRegister(StringTable.optop);
    frameRegister = new LabeledRegister(StringTable.frame);
    varsRegister = new LabeledRegister(StringTable.vars);

    setBackground(ColorTable.registersAreaColor);

    Panel labeledRegisterPanel = new Panel();
    labeledRegisterPanel.setLayout(new GridLayout(1, 4, 5, 5));

    labeledRegisterPanel.add(pcRegister);
    labeledRegisterPanel.add(optopRegister);
    labeledRegisterPanel.add(frameRegister);
    labeledRegisterPanel.add(varsRegister);

    Label title = new Label(StringTable.Registers, Label.CENTER);
    title.setFont(new Font("Helvetica", Font.BOLD, 11));
    add("West", title);
    add("Center", labeledRegisterPanel);
}

From source file:CircleOfSquares.java

StackMemoryView() {

    int[] hComponentCellWidths = new int[4];
    hComponentCellWidths[0] = 2;/*from   w  w w  .j  av  a  2 s.com*/
    hComponentCellWidths[1] = 2;
    hComponentCellWidths[2] = 2;
    hComponentCellWidths[3] = 3;
    setLayout(new GridSnapLayout(memoryLocationsVisibleCount, 9, hComponentCellWidths));

    setBackground(Color.lightGray);
    Font plainFont = new Font("TimesRoman", Font.PLAIN, 11);
    setFont(plainFont);

    Font italicFont = new Font("TimesRoman", Font.ITALIC, 11);

    for (int i = memoryLocationsVisibleCount - 1; i >= 0; --i) {

        pointer[i] = new Label("", Label.RIGHT);
        pointer[i].setFont(italicFont);
        add(pointer[i]);

        address[i] = new Label("", Label.CENTER);
        add(address[i]);

        wordValue[i] = new Label("", Label.CENTER);
        add(wordValue[i]);

        logicalValue[i] = new Label("", Label.CENTER);
        add(logicalValue[i]);
    }
}

From source file:JVMSimulator.java

MemoryView(int methodAreaMemSectionSize) {

    int[] hComponentCellWidths = new int[4];
    hComponentCellWidths[0] = 2;/*w  w  w .  ja  v  a2s  .  c  om*/
    hComponentCellWidths[1] = 2;
    hComponentCellWidths[2] = 2;
    hComponentCellWidths[3] = 3;
    setLayout(new GridSnapLayout(memoryLocationsVisibleCount, 9, hComponentCellWidths));

    setBackground(Color.lightGray);
    Font plainFont = new Font("TimesRoman", Font.PLAIN, 11);
    setFont(plainFont);

    Font italicFont = new Font("TimesRoman", Font.ITALIC, 11);

    for (int i = 0; i < memoryLocationsVisibleCount; ++i) {

        pointer[i] = new Label("", Label.RIGHT);
        pointer[i].setFont(italicFont);
        add(pointer[i]);

        address[i] = new Label("", Label.CENTER);
        add(address[i]);

        byteValue[i] = new Label("", Label.CENTER);
        add(byteValue[i]);

        logicalValue[i] = new Label("", Label.LEFT);
        add(logicalValue[i]);
    }
}

From source file:CircleOfSquares.java

StackMemoryViewTitlePanel() {

    // setLayout(new GridLayout(1, 4));
    int[] hComponentCellWidths = new int[4];
    hComponentCellWidths[0] = 2;/*  w w w  .  j a v  a2 s.co  m*/
    hComponentCellWidths[1] = 2;
    hComponentCellWidths[2] = 2;
    hComponentCellWidths[3] = 3;
    setLayout(new GridSnapLayout(1, 9, hComponentCellWidths));

    setFont(new Font("Helvetica", Font.ITALIC, 11));

    add(new Label("", Label.CENTER));
    add(new Label(StringTable.address, Label.CENTER));
    add(new Label(StringTable.hexValue, Label.CENTER));
    add(new Label(StringTable.value, Label.CENTER));
}

From source file:CircleOfSquares.java

StackPanel() {

    setLayout(new BorderLayout());

    title = new Label("Stack", Label.CENTER);
    title.setFont(new Font("Helvetica", Font.BOLD, 11));

    add("North", title);
    add("Center", memoryView);
}

From source file:JVMSimulator.java

MemoryViewTitlePanel() {

    int[] hComponentCellWidths = new int[4];
    hComponentCellWidths[0] = 2;//from  www. j  a v  a 2  s .c  o  m
    hComponentCellWidths[1] = 2;
    hComponentCellWidths[2] = 2;
    hComponentCellWidths[3] = 3;
    setLayout(new GridSnapLayout(1, 9, hComponentCellWidths));

    setFont(new Font("Helvetica", Font.ITALIC, 11));

    add(new Label("", Label.CENTER));
    add(new Label(StringTable.address, Label.CENTER));
    add(new Label(StringTable.bytecodes, Label.CENTER));
    add(new Label(StringTable.mnemonics, Label.LEFT));
}

From source file:JVMSimulator.java

RegisterPanel() {

    setLayout(new BorderLayout(5, 5));

    pcRegister = new LabeledRegister(StringTable.pc);
    optopRegister = new LabeledRegister(StringTable.optop);
    frameRegister = new LabeledRegister(StringTable.frame);
    varsRegister = new LabeledRegister(StringTable.vars);

    setBackground(SimData.registersAreaColor);

    Panel labeledRegisterPanel = new Panel();
    labeledRegisterPanel.setLayout(new GridLayout(1, 4, 5, 5));

    labeledRegisterPanel.add(pcRegister);
    labeledRegisterPanel.add(optopRegister);
    labeledRegisterPanel.add(frameRegister);
    labeledRegisterPanel.add(varsRegister);

    Label title = new Label(StringTable.Registers, Label.CENTER);
    title.setFont(new Font("Helvetica", Font.BOLD, 11));
    add("West", title);
    add("Center", labeledRegisterPanel);
}

From source file:JVMSimulator.java

StackMemoryViewTitlePanel() {

    int[] hComponentCellWidths = new int[4];
    hComponentCellWidths[0] = 2;//from  www .ja v  a  2s.co m
    hComponentCellWidths[1] = 2;
    hComponentCellWidths[2] = 2;
    hComponentCellWidths[3] = 3;
    setLayout(new GridSnapLayout(1, 9, hComponentCellWidths));

    setFont(new Font("Helvetica", Font.ITALIC, 11));

    add(new Label("", Label.CENTER));
    add(new Label(StringTable.address, Label.CENTER));
    add(new Label(StringTable.hexValue, Label.CENTER));
    add(new Label(StringTable.value, Label.CENTER));
}