本文整理匯總了Java中java.awt.Frame.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java Frame.setTitle方法的具體用法?Java Frame.setTitle怎麽用?Java Frame.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.Frame
的用法示例。
在下文中一共展示了Frame.setTitle方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPartControl
import java.awt.Frame; //導入方法依賴的package包/類
@Override
public void createPartControl(final Composite parent) {
final Object viewer = Test.getViewer();
final Composite composite = new Composite(parent, SWT.EMBEDDED);
final Frame frame = SWT_AWT.new_Frame(composite);
frame.setTitle("Antlr AST");
scrollPane = new JScrollPane();
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBounds(0, 0, 500, 500);
scrollPane.getViewport().add((Component) viewer);
frame.add(scrollPane);
// frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(Toolkit.getDefaultToolkit().getScreenSize().width, 500);
frame.setVisible(true);
}
示例2: createFrame
import java.awt.Frame; //導入方法依賴的package包/類
private static Frame createFrame(String title, int x, int y) {
Frame frame = new Frame();
frame.setSize(200, 200);
frame.setLocation(x, y);
frame.setTitle(title);
frame.setVisible(true);
return frame;
}
示例3: initTestWindow
import java.awt.Frame; //導入方法依賴的package包/類
public static void initTestWindow() {
mainFrame = new Frame();
p1 = new Panel();
mainFrame.setTitle("TestWindow");
mainFrame.setBounds(700, 10, 400, 100);
tf = new TextField(20);
tf.select(0, 10);
bt = new Button("Disable textfield");
p1.add(tf);
p1.add(bt);
mainFrame.add(p1);
bt.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
tf.setEditable(false);
}
});
mainFrame.setVisible(true);
}
示例4: initTestWindow
import java.awt.Frame; //導入方法依賴的package包/類
public static void initTestWindow() {
mainFrame = new Frame();
mainFrame.setTitle("TestWindow");
mainFrame.setBounds(700, 10, 300, 300);
mainFrame.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
int ex = e.getModifiersEx();
if ((ex & InputEvent.ALT_GRAPH_DOWN_MASK) == 0) {
AltGraphModifierTest.fail("Alt-Gr Modifier bit is not set.");
} else {
AltGraphModifierTest.pass();
}
}
});
mainFrame.setVisible(true);
}
示例5: show
import java.awt.Frame; //導入方法依賴的package包/類
private void show(String title) {
Frame frame = new Frame() {
@Override
public void paint(Graphics g) {
super.paint(g);
g.drawImage(buffImage, 0, 0, this);
g.setColor(Color.GRAY);
g.drawRect(0, 0, width, height);
g.drawRect(0, height / 2, width, height / 2);
g.drawRect(width / 2, 0, width / 2, height);
}
};
frame.setTitle(title);
frame.setSize(width, height);
frame.setVisible(true);
}
示例6: getCenteredFrame
import java.awt.Frame; //導入方法依賴的package包/類
public static Frame getCenteredFrame() {
Frame tempframe = new Frame();
tempframe.setSize(0, 0);
Toolkit tool = Toolkit.getDefaultToolkit();
tempframe.setLocation(tool.getScreenSize().width / 2 - 200, tool
.getScreenSize().height / 2 - 150);
tempframe.setTitle("Dialog Box!");
//tempframe.show();
return tempframe;
}
示例7: createGUI
import java.awt.Frame; //導入方法依賴的package包/類
public void createGUI() {
frame = new Frame();
frame.setTitle("ExtendedModifiersTest");
frame.setLayout(new GridLayout(1, 6));
button = new Button();
button.addKeyListener(this);
frame.add(button);
buttonLW = new LWButton();
buttonLW.addKeyListener(this);
frame.add(buttonLW);
textField = new TextField(5);
textField.addKeyListener(this);
frame.add(textField);
textArea = new TextArea(5, 5);
textArea.addKeyListener(this);
frame.add(textArea);
list = new List();
for (int i = 1; i <= 5; ++i) {
list.add("item " + i);
}
list.addKeyListener(this);
frame.add(list);
listLW = new LWList();
for (int i = 1; i <= 5; ++i) {
listLW.add("item " + i);
}
listLW.addKeyListener(this);
frame.add(listLW);
frame.setBackground(Color.gray);
frame.setSize(500, 100);
frame.setVisible(true);
frame.toFront();
}