javax.swing.JLabel.setAlignmentX()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(261)

本文整理了Java中javax.swing.JLabel.setAlignmentX()方法的一些代码示例,展示了JLabel.setAlignmentX()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.setAlignmentX()方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:setAlignmentX

JLabel.setAlignmentX介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Box box = Box.createVerticalBox();
 JLabel label1 = new JLabel("test1, the beginning");
 label1.setAlignmentX(Component.RIGHT_ALIGNMENT);
 box.add(label1);
 JLabel label2 = new JLabel("test2, some more");
 label2.setAlignmentX(Component.RIGHT_ALIGNMENT);
 box.add(label2);
 JLabel label3 = new JLabel("test3");
 label3.setAlignmentX(Component.RIGHT_ALIGNMENT);
 box.add(label3);
 add(box);

代码示例来源:origin: skylot/jadx

public final void initUI() {
  Font font = new Font("Serif", Font.BOLD, 13);
  JLabel name = new JLabel("jadx");
  name.setFont(font);
  name.setAlignmentX(0.5f);
  JLabel desc = new JLabel("Dex to Java decompiler");
  desc.setFont(font);
  desc.setAlignmentX(0.5f);
  JLabel version = new JLabel("version: " + JadxDecompiler.getVersion());
  version.setFont(font);
  version.setAlignmentX(0.5f);

代码示例来源:origin: stanfordnlp/CoreNLP

JLabel text = new JLabel("<html>A head finder or tree reader was selected that has the default encoding " + encoding
  + "; this differs from " + oldEncoding + ", which was being used. If the encoding is changed, all newly loaded" +
  "treebanks will be read using the new encoding. Choosing an encoding that is not the true encoding of your tree " +
  "files may cause errors and unexpected behavior.</html>");
text.setAlignmentX(SwingConstants.LEADING);
JPanel textPanel = new JPanel(new BorderLayout());
textPanel.setPreferredSize(new Dimension(100,100));

代码示例来源:origin: libgdx/libgdx

panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
for (String subIncompat : incompatList) {
  JLabel label = new JLabel(subIncompat);
  label.setAlignmentX(Component.CENTER_ALIGNMENT);
  panel.add(label);
JLabel infoLabel = new JLabel("<html><br><br>The project can be generated, but you wont be able to use these extensions in the respective sub modules<br>Please see the link to learn about extensions</html>");
infoLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
panel.add(infoLabel);
JEditorPane pane = new JEditorPane("text/html", "<a href=\"https://github.com/libgdx/libgdx/wiki/Dependency-management-with-Gradle\">Dependency Management</a>");

代码示例来源:origin: stanfordnlp/CoreNLP

final JPanel fileFilterPanel = new JPanel();
fileFilterPanel.setLayout(new BoxLayout(fileFilterPanel, BoxLayout.PAGE_AXIS));
JLabel text = new JLabel("<html>Please indicate any constraints on the files you want to load. All files in specified folders that satisfy all of the given constraints will be loaded. Just press Okay to load all files.</html>");
text.setAlignmentX(SwingConstants.LEADING);
JPanel textPanel = new JPanel(new BorderLayout());
textPanel.setPreferredSize(new Dimension(100,50));
   JOptionPane.showMessageDialog(dialog, new JLabel("<html>Please check the range you specified for the file number.  Ranges must be numerical, and disjoint <br>ranges should be separated by commas.  For example \"1-200,250-375\" is a valid range.</html>"), "Error in File Number Range", JOptionPane.ERROR_MESSAGE);
   return;

代码示例来源:origin: marytts/marytts

controls.add(checkLPC);
JLabel lpcLabel = new JLabel("LPC order:");
lpcLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(lpcLabel);
int min = 1;

代码示例来源:origin: marytts/marytts

controls.add(checkLPC);
JLabel lpcLabel = new JLabel("LPC order:");
lpcLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(lpcLabel);
int min = 1;

代码示例来源:origin: marytts/marytts

controls.add(checkCepstrum);
JLabel cepstrumLabel = new JLabel("Cepstrum cutoff:");
cepstrumLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(cepstrumLabel);
int min = 1;

代码示例来源:origin: marytts/marytts

controls.add(checkCepstrum);
JLabel cepstrumLabel = new JLabel("Cepstrum cutoff:");
cepstrumLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(cepstrumLabel);
int min = 1;

代码示例来源:origin: libgdx/libgdx

textPanel.add(textField);
final JLabel placeholderLabel = new JLabel(hint);
placeholderLabel.setForeground(Color.GRAY);
placeholderLabel.setAlignmentX(0.0f);
textPanel.add(placeholderLabel, 0);

代码示例来源:origin: 4thline/cling

public Component getListCellRendererComponent(JList list, Object value, int index,
                         boolean isSelected, boolean cellHasFocus) {
    assert value instanceof DeviceItem;
    DeviceItem display = (DeviceItem) value;
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));
    JLabel iconLabel = new JLabel(display.getIcon());
    iconLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
    panel.add(iconLabel);
    for (String label : display.getLabel()) {
      JLabel l = new JLabel(label);
      // First label is larger font
      if (display.getLabel()[0].equals(label)) {
        Application.increaseFontSize(l);
      } else {
        Application.decreaseFontSize(l);
      }
      l.setAlignmentX(Component.CENTER_ALIGNMENT);
      panel.add(l);
    }
    panel.setBackground(Color.WHITE);
    if (isSelected) {
      iconLabel.setBorder(new LineBorder(Constants.GREEN_DARK, 4));
    } else {
      iconLabel.setBorder(new LineBorder(Color.WHITE, 4));
    }
    return panel;
  }
}

代码示例来源:origin: libgdx/libgdx

textPanel.add(textField);
final JLabel placeholderLabel = new JLabel(hint);
placeholderLabel.setForeground(Color.GRAY);
placeholderLabel.setAlignmentX(0.0f);
textPanel.add(placeholderLabel, 0);

代码示例来源:origin: libgdx/libgdx

textPanel.add(textField);
final JLabel placeholderLabel = new JLabel(hint);
placeholderLabel.setForeground(Color.GRAY);
placeholderLabel.setAlignmentX(0.0f);
textPanel.add(placeholderLabel, 0);

代码示例来源:origin: libgdx/libgdx

textPanel.add(textField);
final JLabel placeholderLabel = new JLabel(hint);
placeholderLabel.setForeground(Color.GRAY);
placeholderLabel.setAlignmentX(0.0f);
textPanel.add(placeholderLabel, 0);

代码示例来源:origin: marytts/marytts

JLabel fftLabel = new JLabel("FFT size:");
fftLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(fftLabel);
int min = 5;
for (int i = min; i <= max; i++) {
  int twoPowI = 1 << i; // 2^i, e.g. i==8 => twoPowI==256
  labelTable.put(new Integer(i), new JLabel(String.valueOf(twoPowI)));
JLabel windowTypeLabel = new JLabel("Window type:");
windowTypeLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(windowTypeLabel);
int[] windowTypes = Window.getAvailableTypes();

代码示例来源:origin: marytts/marytts

JLabel fftLabel = new JLabel("FFT size:");
fftLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(fftLabel);
int min = 5;
for (int i = min; i <= max; i++) {
  int twoPowI = 1 << i; // 2^i, e.g. i==8 => twoPowI==256
  labelTable.put(new Integer(i), new JLabel(String.valueOf(twoPowI)));
JLabel windowTypeLabel = new JLabel("Window type:");
windowTypeLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(windowTypeLabel);
int[] windowTypes = Window.getAvailableTypes();

代码示例来源:origin: marytts/marytts

JLabel fftLabel = new JLabel("FFT size:");
fftLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(fftLabel);
int min = 5;
for (int i = min; i <= max; i++) {
  int twoPowI = 1 << i; // 2^i, e.g. i==8 => twoPowI==256
  labelTable.put(new Integer(i), new JLabel(String.valueOf(twoPowI)));
JLabel windowTypeLabel = new JLabel("Window type:");
windowTypeLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(windowTypeLabel);
int[] windowTypes = Window.getAvailableTypes();

代码示例来源:origin: marytts/marytts

JLabel fftLabel = new JLabel("FFT size:");
fftLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(fftLabel);
int min = 5;
for (int i = min; i <= max; i++) {
  int twoPowI = 1 << i; // 2^i, e.g. i==8 => twoPowI==256
  labelTable.put(new Integer(i), new JLabel(String.valueOf(twoPowI)));
JLabel windowTypeLabel = new JLabel("Window type:");
windowTypeLabel.setAlignmentX(CENTER_ALIGNMENT);
controls.add(windowTypeLabel);
int[] windowTypes = Window.getAvailableTypes();

代码示例来源:origin: redwarp/9-Patch-Resizer

optionPanel.add(Box.createVerticalGlue());
JLabel inputLabel = new JLabel(Localization.get("input_density"));
inputLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
optionPanel.add(inputLabel);
inputDensityChoice = new JComboBox<ScreenDensity>(
optionPanel.add(Box.createVerticalGlue());
JLabel outputLabel = new JLabel(Localization.get("output_density"));
optionPanel.add(outputLabel);
for (final ScreenDensity density : Configuration.getSettings().getSupportedScreenDensity()) {

代码示例来源:origin: geotools/geotools

private Component titledImagePanel(String string, RenderedImage expected) {
  JPanel panel = new JPanel(new BorderLayout());
  final JLabel title = new JLabel(string);
  title.setAlignmentX(0.5f);
  title.setBorder(new LineBorder(Color.BLACK));
  panel.add(title, BorderLayout.NORTH);
  panel.add(
      new ScrollingImagePanel(
          expected,
          Math.min(400, expected.getWidth()),
          Math.min(400, expected.getHeight())),
      BorderLayout.CENTER);
  return panel;
}

相关文章

JLabel类方法