本文整理匯總了Java中java.awt.GridBagConstraints.PAGE_START屬性的典型用法代碼示例。如果您正苦於以下問題:Java GridBagConstraints.PAGE_START屬性的具體用法?Java GridBagConstraints.PAGE_START怎麽用?Java GridBagConstraints.PAGE_START使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.GridBagConstraints
的用法示例。
在下文中一共展示了GridBagConstraints.PAGE_START屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DetectorPanel
public DetectorPanel(){
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
setPreferredSize(new Dimension(250,130));
setBackground(Color.WHITE);
this.detectorLabel= new JLabel("OBRAZ DETEKTORA");
c.gridx = 0;
c.gridy = 0;
c.anchor=GridBagConstraints.PAGE_START;
this.detectorLabel.setFont(this.header);
this.add(this.detectorLabel,c);
this.detectorImage = new DetectorImage();
c.gridy = 1;
c.insets = new Insets(5,0,5,0);
this.add(this.detectorImage,c);
}
示例2: setComponentArea
private void setComponentArea() {
compArea.removeAll();
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.ipadx = 4;
c.ipady = 2;
c.anchor = GridBagConstraints.PAGE_START;
c.gridy = -1;
int i = 0;
for (SNESButton b : SNESButton.values()) {
JLabel lbl = new JLabel(b.name);
CompWrapper k = activeController.list[i];
list[i++] = k;
c.gridy++;
c.gridx = 0;
compArea.add(lbl, c);
c.gridx = 1;
compArea.add(k.text, c);
}
revalidate();
repaint();
}
示例3: RunButtonPanel
public RunButtonPanel() {
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
setPreferredSize(new Dimension(300,150));
setBackground(Color.WHITE);
this.fizeauButton =new JButton("Zrób to jak Fizeau");
c.gridx = 0;
c.gridy = 0;
c.anchor=GridBagConstraints.PAGE_START;
this.fizeauButton.setFont(this.mainFont);
this.fizeauButton.setPreferredSize(new Dimension(200, 35));
this.add(this.fizeauButton,c);
this.runButton = new JButton ("START/ STOP");
c.gridy = 1;
c.insets = new Insets(10,0,0,0);
this.runButton.setFont(this.mainFont);
this.runButton.setPreferredSize(new Dimension(200, 35));
this.add(this.runButton,c);
this.saveButton = new JButton("Zapisz do pliku tekstowego");
c.gridy = 2;
this.saveButton.setFont(mainFont);
this.saveButton.setPreferredSize(new Dimension(200, 35));
this.add(saveButton,c);
}
示例4: setInsideLocation
final public ExtendedGridBagConstraints setInsideLocation(int intPinsideLocation) {
switch (intPinsideLocation) {
case GridBagConstraints.PAGE_START:
case GridBagConstraints.PAGE_END:
case GridBagConstraints.LINE_START:
case GridBagConstraints.LINE_END:
case GridBagConstraints.FIRST_LINE_START:
case GridBagConstraints.FIRST_LINE_END:
case GridBagConstraints.LAST_LINE_START:
case GridBagConstraints.LAST_LINE_END:
case GridBagConstraints.BASELINE:
case GridBagConstraints.BASELINE_LEADING:
case GridBagConstraints.BASELINE_TRAILING:
case GridBagConstraints.ABOVE_BASELINE:
case GridBagConstraints.ABOVE_BASELINE_LEADING:
case GridBagConstraints.ABOVE_BASELINE_TRAILING:
case GridBagConstraints.BELOW_BASELINE:
case GridBagConstraints.BELOW_BASELINE_LEADING:
case GridBagConstraints.BELOW_BASELINE_TRAILING:
Tools.err("strange grid anchor value : ", intPinsideLocation);
//$FALL-THROUGH$
case GridBagConstraints.CENTER:
case GridBagConstraints.NORTH:
case GridBagConstraints.NORTHWEST:
case GridBagConstraints.NORTHEAST:
case GridBagConstraints.SOUTH:
case GridBagConstraints.SOUTHWEST:
case GridBagConstraints.SOUTHEAST:
case GridBagConstraints.WEST:
case GridBagConstraints.EAST:
this.anchor = intPinsideLocation;
break;
default:
Tools.err("bad grid anchor value : ", intPinsideLocation);
}
return this;
}
示例5: insertLabel
private void insertLabel(String label) {
GridBagConstraints c = new GridBagConstraints();
c.gridy = nextrow;
c.anchor = GridBagConstraints.PAGE_START;
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.weightx = 0.0;
c.ipady = 5;
c.ipadx = 10;
add(new JLabel(label), c);
}
示例6: insertValue
private void insertValue(JComponent value) {
GridBagConstraints c = new GridBagConstraints();
c.gridy = nextrow++;
c.anchor = GridBagConstraints.PAGE_START;
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.weightx = 1.0;
c.ipady = 5;
c.ipadx = 10;
add(value, c);
}
示例7: VariableTab
VariableTab(VariableList data) {
this.data = data;
list.setModel(new VariableListModel(data));
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.addListSelectionListener(myListener);
remove.addActionListener(myListener);
moveUp.addActionListener(myListener);
moveDown.addActionListener(myListener);
add.addActionListener(myListener);
rename.addActionListener(myListener);
field.addActionListener(myListener);
field.getDocument().addDocumentListener(myListener);
JScrollPane listPane = new JScrollPane(list, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
listPane.setPreferredSize(new Dimension(100, 100));
JPanel topPanel = new JPanel(new GridLayout(3, 1));
topPanel.add(remove);
topPanel.add(moveUp);
topPanel.add(moveDown);
JPanel fieldPanel = new JPanel();
fieldPanel.add(rename);
fieldPanel.add(add);
GridBagLayout gb = new GridBagLayout();
GridBagConstraints gc = new GridBagConstraints();
setLayout(gb);
gc.insets = new Insets(10, 10, 0, 10);
gc.fill = GridBagConstraints.BOTH;
gc.weightx = 1.0;
gb.setConstraints(listPane, gc);
add(listPane);
gc.fill = GridBagConstraints.NONE;
gc.anchor = GridBagConstraints.PAGE_START;
gc.weightx = 0.0;
gb.setConstraints(topPanel, gc);
add(topPanel);
gc.gridwidth = GridBagConstraints.REMAINDER;
gc.gridx = 0;
gc.gridy = GridBagConstraints.RELATIVE;
gc.fill = GridBagConstraints.HORIZONTAL;
gb.setConstraints(field, gc);
field.setBorder(BorderFactory.createLineBorder(new Color(130, 135, 144)));
add(field);
gb.setConstraints(fieldPanel, gc);
add(fieldPanel);
gc.fill = GridBagConstraints.HORIZONTAL;
gb.setConstraints(error, gc);
add(error);
if (!data.isEmpty())
list.setSelectedValue(data.get(0), true);
computeEnabled();
}