本文整理了Java中java.awt.Panel.<init>()
方法的一些代码示例,展示了Panel.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Panel.<init>()
方法的具体详情如下:
包路径:java.awt.Panel
类名称:Panel
方法名:<init>
暂无
代码示例来源:origin: chewiebug/GCViewer
protected void initComponents() {
Panel buttonPanel = new Panel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
JButton okButton = new JButton(LocalisationHelper.getString("button_ok"));
okButton.setActionCommand(ACTION_OK);
okButton.addActionListener(this);
buttonPanel.add(okButton);
getContentPane().add("South", buttonPanel);
}
代码示例来源:origin: gocd/gocd
aboutLabel[7] = new JLabel("");
Panel textPanel2 = new Panel(new GridLayout(labelCount, 1));
for (int i = 0; i < labelCount; i++) {
aboutLabel[i].setHorizontalAlignment(JLabel.CENTER);
textPanel2.add(aboutLabel[i]);
代码示例来源:origin: wildfly/wildfly
public SendDialog(Frame parent, Node dest, String src, RpcDispatcher disp) {
super(parent, "Send message to " + dest.lbl + " at " + dest.addr, true);
Panel p1=new Panel(), p2=new Panel();
Button send=new Button("Send"), send_all=new Button("Send to all");
Button cancel=new Button("Cancel");
this.disp=disp;
this.dest=dest;
sender=src;
send.setFont(default_font);
send_all.setFont(default_font);
cancel.setFont(default_font);
msg.setFont(default_font);
p1.setLayout(new BorderLayout());
p1.add(msg);
p2.setLayout(new FlowLayout());
send.addActionListener(this);
send_all.addActionListener(this);
cancel.addActionListener(this);
p2.add(send);
p2.add(send_all);
p2.add(cancel);
add("Center", p1);
add("South", p2);
setSize(300, 150);
Point my_loc=parent.getLocation();
my_loc.x+=50;
my_loc.y+=150;
setLocation(my_loc);
setVisible(true);
}
代码示例来源:origin: com.h2database/h2
Panel mainPanel = new Panel(layout);
mainPanel.add(label, constraintsLabel);
urlText.setFocusable(false);
mainPanel.add(urlText, constraintsTextField);
startBrowser = new Button("Start Browser");
startBrowser.setFocusable(false);
startBrowser.setActionCommand("console");
startBrowser.addActionListener(this);
startBrowser.setFont(font);
mainPanel.add(startBrowser, constraintsButton);
frame.add(mainPanel, constraintsPanel);
代码示例来源:origin: magefree/mage
pnlPacks = new java.awt.Panel();
pnlSelect = new javax.swing.JPanel();
btnNone = new javax.swing.JButton();
pnlPacks.setLayout(new java.awt.GridLayout(11, 12));
代码示例来源:origin: wildfly/wildfly
public void go() {
try {
panel=new Panel();
sub_panel=new Panel();
resize(200, 200);
add("Center", panel);
clear_button=new Button("Clear");
clear_button.setFont(default_font);
clear_button.addActionListener(this);
leave_button=new Button("Exit");
leave_button.setFont(default_font);
leave_button.addActionListener(this);
mbr_label=new Label("0 mbr(s)");
mbr_label.setFont(default_font);
sub_panel.add("South", clear_button);
sub_panel.add("South", leave_button);
sub_panel.add("South", mbr_label);
add("South", sub_panel);
panel.addMouseMotionListener(this);
代码示例来源:origin: stackoverflow.com
**Panel p = new Panel ();
p.setLayout(new BorderLayout());//it's a container
p.addKeyListener (this);
p.add (dp);
frame.getContentPane().add(p);**
代码示例来源:origin: stackoverflow.com
import java.awt.*;
import java.awt.event.*;
public class Party {
public void buildInvite() {
Frame f = new Frame();
Label l = new Label("Party at Tim's");
Button b = new Button("You Bet");
Button c = new Button("Shoot Me");
Panel p = new Panel();
p.add(l);
p.add(b);
p.add(c);
f.add(p);
f.pack();
f.setVisible(true);
}
public static void main(String[] args) {
new Party().buildInvite();
}
}
代码示例来源:origin: IanDarwin/javasrc
public void init() {
Button b = new Button("Start");
b.addActionListener(this);
setLayout(new BorderLayout());
add(b, BorderLayout.NORTH);
add(p = new Panel(), BorderLayout.CENTER);
p.setLayout(null);
String imgName = getParameter("imagefile");
if (imgName == null) imgName = "duke.gif";
img = getImage(getCodeBase(), imgName);
MediaTracker mt = new MediaTracker(this);
mt.addImage(img, 0);
try {
mt.waitForID(0);
} catch(InterruptedException e) {
throw new IllegalArgumentException(
"InterruptedException while loading image " + imgName);
}
if (mt.isErrorID(0)) {
throw new IllegalArgumentException(
"Couldn't load image " + imgName);
}
v = new Vector<Sprite>(); // multithreaded, use Vector
}
代码示例来源:origin: javax.activation/activation
setLayout(panel_gb);
button_panel = new Panel();
button_panel.setLayout( new FlowLayout() );
save_button = new Button("SAVE");
button_panel.add(save_button);
addGridComponent(this,
button_panel,
代码示例来源:origin: FudanNLP/fnlp
Panel panel=new Panel();
panel.setLayout(null);
int sp=3;
int width=getWidth()-15;
jspOut.setBounds(sp, sp, width-sp*2, height*5/6);
jspIn.setBounds(sp, height*5/6+sp*2, width*4/5-sp*2, height*1/6);
panel.add(jspIn);
panel.add(jspOut);
panel.add(button);
代码示例来源:origin: wildfly/wildfly
panel.setBackground(Color.white);
add("Center", panel);
Panel p = new Panel();
leave_button = new Button("Exit");
leave_button.setFont(default_font);
leave_button.addActionListener(this);
mbr_label = new Label("1 mbr(s)");
mbr_label.setFont(default_font);
p.add("South", leave_button);
p.add("South", mbr_label);
add("South", p);
代码示例来源:origin: gocd/gocd
public MacAboutBox() {
super("");
setResizable(false);
addWindowListener(new SymWindow());
getContentPane().setLayout(new BorderLayout(15, 15));
List<JLabel> aboutLabels = new ArrayList<>();
aboutLabels.add(emptyLabel());
aboutLabels.add(titleLabel("Go Agent"));
aboutLabels.add(bodyLabel("Bootstrapper Version " + getBootstrapperVersion()));
aboutLabels.add(emptyLabel());
aboutLabels.add(bodyLabel("Java Version " + System.getProperty("java.version")));
aboutLabels.add(bodyLabel("Copyright (C) 2015 ThoughtWorks Inc."));
aboutLabels.add(emptyLabel());
Panel textPanel2 = new Panel(new GridLayout(aboutLabels.size(), 1));
for (JLabel aboutLabel : aboutLabels) {
textPanel2.add(aboutLabel);
}
getContentPane().add(textPanel2, BorderLayout.CENTER);
pack();
setLocation(FRAME_LEFT, FRAME_TOP);
setSize(FRAME_WIDTH, FRAME_HEIGHT);
setResizable(false);
}
代码示例来源:origin: stackoverflow.com
Panel p = new Panel();
p.setLayout(new BorderLayout());
代码示例来源:origin: stackoverflow.com
import java.awt.*;
import java.awt.event.*;
public class ChangeCursor{
public static void main(String[] args) {
Frame f = new Frame("Change cursor");
Panel panel = new Panel();
Button comp1 = new Button("Ok");
Button comp2 = new Button("Cancel");
panel.add(comp1);
panel.add(comp2);
f.add(panel,BorderLayout.CENTER);
f.setSize(200,200);
f.setVisible(true);
Cursor cur = comp1.getCursor();
Cursor cur1 = comp2.getCursor();
comp1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
comp2.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
System.exit(0);
}
});
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
setLayout(panel_gb);
button_panel = new Panel();
button_panel.setLayout( new FlowLayout() );
save_button = new Button("SAVE");
button_panel.add(save_button);
addGridComponent(this,
button_panel,
代码示例来源:origin: chewiebug/GCViewer
public AboutDialog(Frame f) {
super(f, LocalisationHelper.getString("about_dialog_title"));
Panel logoPanel = new Panel();
ImageIcon logoIcon = ImageHelper.loadImageIcon(LocalisationHelper.getString("about_dialog_image"));
JLabel la_icon = new JLabel(logoIcon);
la_icon.setBorder(new SoftBevelBorder(SoftBevelBorder.LOWERED));
logoPanel.add(la_icon);
versionPanel.add(buildDate, gridBagConstraints);
Panel buttonPanel = new Panel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
if (UrlDisplayHelper.displayUrlIsSupported()) {
JButton homePageButton = new JButton("Homepage");
homePageButton.setActionCommand(ACTION_HOMEPAGE);
homePageButton.addActionListener(this);
buttonPanel.add(homePageButton);
okButton.setActionCommand(ACTION_OK);
okButton.addActionListener(this);
buttonPanel.add(okButton);
getContentPane().add("North", logoPanel);
getContentPane().add("Center", versionPanel);
代码示例来源:origin: net.imagej/ij
Panel makeButtonPanel(GenericDialog gd) {
Panel panel = new Panel();
//buttons.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0));
colorButton = new Button("\"Show All\" Color...");
colorButton.addActionListener(this);
panel.add(colorButton);
return panel;
}
代码示例来源:origin: stackoverflow.com
Panel createPanel() {
Panel p = new Panel();
Label l = new Label("Heading");
p.add(l);
return p;
}
代码示例来源:origin: org.scijava/scijava-ui-awt
@Override
public Panel getComponent() {
if (uiComponent == null) {
uiComponent = new Panel();
uiComponent.setLayout(new MigLayout("wrap 2"));
}
return uiComponent;
}
内容来源于网络,如有侵权,请联系作者删除!