当前位置: 首页>>代码示例>>Java>>正文


Java FlowLayout.TRAILING属性代码示例

本文整理汇总了Java中java.awt.FlowLayout.TRAILING属性的典型用法代码示例。如果您正苦于以下问题:Java FlowLayout.TRAILING属性的具体用法?Java FlowLayout.TRAILING怎么用?Java FlowLayout.TRAILING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.FlowLayout的用法示例。


在下文中一共展示了FlowLayout.TRAILING属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AlignmentPropertyEditor

public AlignmentPropertyEditor() {
    super(
        new int[] {
            FlowLayout.CENTER,
            FlowLayout.LEFT,
            FlowLayout.RIGHT,
            FlowLayout.LEADING,
            FlowLayout.TRAILING
        },
        new String[] {
            "java.awt.FlowLayout.CENTER", // NOI18N
            "java.awt.FlowLayout.LEFT", // NOI18N
            "java.awt.FlowLayout.RIGHT", // NOI18N
            "java.awt.FlowLayout.LEADING", // NOI18N
            "java.awt.FlowLayout.TRAILING" // NOI18N
        },
        new String[] {
            "VALUE_AlignmentCenter", // NOI18N
            "VALUE_AlignmentLeft", // NOI18N
            "VALUE_AlignmentRight", // NOI18N
            "VALUE_AlignmentLeading", // NOI18N
            "VALUE_AlignmentTrailing" // NOI18N
        }
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:FlowLayoutBeanInfo.java

示例2: initComponents

private void initComponents() {
    setOpaque(false);
    setLayout(new BorderLayout());
    setBorder(BorderFactory.createEmptyBorder(5, 5, 4, 5));

    JPanel legendPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING, 5, 0));
    legendPanel.setOpaque(false);

    gcRootLegend = new JLabel(Bundle.ClassesListController_GcRootString(), BrowserUtils.ICON_GCROOT, SwingConstants.LEFT);
    gcRootLegendDivider = new JLabel("|"); // NOI18N

    legendPanel.add(new JLabel(Bundle.ClassesListController_ArrayTypeString(), BrowserUtils.ICON_ARRAY, SwingConstants.LEFT));
    legendPanel.add(new JLabel("|")); // NOI18N
    legendPanel.add(new JLabel(Bundle.ClassesListController_ObjectTypeString(), BrowserUtils.ICON_INSTANCE, SwingConstants.LEFT));
    legendPanel.add(new JLabel("|")); // NOI18N
    legendPanel.add(new JLabel(Bundle.ClassesListController_PrimitiveTypeString(), BrowserUtils.ICON_PRIMITIVE, SwingConstants.LEFT));
    legendPanel.add(new JLabel("|")); // NOI18N
    legendPanel.add(new JLabel(Bundle.ClassesListController_StaticFieldString(), BrowserUtils.ICON_STATIC, SwingConstants.LEFT));
    legendPanel.add(new JLabel("|")); // NOI18N
    legendPanel.add(gcRootLegend);
    legendPanel.add(gcRootLegendDivider);
    legendPanel.add(new JLabel(Bundle.ClassesListController_LoopString(), BrowserUtils.ICON_LOOP, SwingConstants.LEFT));

    //add(new JLabel("Legend:"), BorderLayout.WEST);
    add(legendPanel, BorderLayout.EAST);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:LegendPanel.java

示例3: initPageDialog

/**
 * Initialize "page setup" dialog
 */
void initPageDialog(int x, int y,
                     PrintService ps,
                     DocFlavor flavor,
                     PrintRequestAttributeSet attributes)
{
    this.psCurrent = ps;
    this.docFlavor = flavor;
    this.asOriginal = attributes;
    this.asCurrent = new HashPrintRequestAttributeSet(attributes);

    Container c = getContentPane();
    c.setLayout(new BorderLayout());

    pnlPageSetup = new PageSetupPanel();
    c.add(pnlPageSetup, BorderLayout.CENTER);

    pnlPageSetup.updateInfo();

    JPanel pnlSouth = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    btnApprove = createExitButton("button.ok", this);
    pnlSouth.add(btnApprove);
    getRootPane().setDefaultButton(btnApprove);
    btnCancel = createExitButton("button.cancel", this);
    handleEscKey(btnCancel);
    pnlSouth.add(btnCancel);
    c.add(pnlSouth, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            dispose(CANCEL);
        }
    });

    getAccessibleContext().setAccessibleDescription(getMsg("dialog.pstitle"));
    setResizable(false);
    setLocation(x, y);
    pack();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:ServiceDialog.java

示例4: initPrintDialog

/**
 * Initialize print dialog.
 */
void initPrintDialog(int x, int y,
                     PrintService[] services,
                     int defaultServiceIndex,
                     DocFlavor flavor,
                     PrintRequestAttributeSet attributes)
{
    this.services = services;
    this.defaultServiceIndex = defaultServiceIndex;
    this.asOriginal = attributes;
    this.asCurrent = new HashPrintRequestAttributeSet(attributes);
    this.psCurrent = services[defaultServiceIndex];
    this.docFlavor = flavor;
    SunPageSelection pages =
        (SunPageSelection)attributes.get(SunPageSelection.class);
    if (pages != null) {
        isAWT = true;
    }

    if (attributes.get(DialogOnTop.class) != null) {
        setAlwaysOnTop(true);
    }
    Container c = getContentPane();
    c.setLayout(new BorderLayout());

    tpTabs = new JTabbedPane();
    tpTabs.setBorder(new EmptyBorder(5, 5, 5, 5));

    String gkey = getMsg("tab.general");
    int gmnemonic = getVKMnemonic("tab.general");
    pnlGeneral = new GeneralPanel();
    tpTabs.add(gkey, pnlGeneral);
    tpTabs.setMnemonicAt(0, gmnemonic);

    String pkey = getMsg("tab.pagesetup");
    int pmnemonic = getVKMnemonic("tab.pagesetup");
    pnlPageSetup = new PageSetupPanel();
    tpTabs.add(pkey, pnlPageSetup);
    tpTabs.setMnemonicAt(1, pmnemonic);

    String akey = getMsg("tab.appearance");
    int amnemonic = getVKMnemonic("tab.appearance");
    pnlAppearance = new AppearancePanel();
    tpTabs.add(akey, pnlAppearance);
    tpTabs.setMnemonicAt(2, amnemonic);

    c.add(tpTabs, BorderLayout.CENTER);

    updatePanels();

    JPanel pnlSouth = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    btnApprove = createExitButton("button.print", this);
    pnlSouth.add(btnApprove);
    getRootPane().setDefaultButton(btnApprove);
    btnCancel = createExitButton("button.cancel", this);
    handleEscKey(btnCancel);
    pnlSouth.add(btnCancel);
    c.add(pnlSouth, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            dispose(CANCEL);
        }
    });

    getAccessibleContext().setAccessibleDescription(getMsg("dialog.printtitle"));
    setResizable(false);
    setLocation(x, y);
    pack();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:72,代码来源:ServiceDialog.java

示例5: createImportFailedPane

private JComponent createImportFailedPane( Exception cause ) {
    JLabel infoLabel = new JLabel( NbBundle.getMessage( ProgressTrackingPanel.class, "ProgressTrackingPanel.importFailedMessage" ));
    infoLabel.setHorizontalAlignment(JLabel.CENTER );
    infoLabel.setBackground(Color.red);
    infoLabel.setOpaque(true);
    infoLabel.setBorder( BorderFactory.createLineBorder(Color.red, 3) );
    
    ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream();
    PrintWriter printWriter = new PrintWriter( arrayOutputStream );
    cause.printStackTrace( printWriter );
    printWriter.flush();
    String stackTraceText = arrayOutputStream.toString();
    
    JTextArea stackTraceTextArea = new JTextArea( stackTraceText );
    stackTraceTextArea.setEditable(false);
    
    JScrollPane scrollPane = new JScrollPane( stackTraceTextArea );        
    
    JButton copyToClipboardButton = new JButton( NbBundle.getMessage( ProgressTrackingPanel.class, "ProgressTrackingPanel.copyToClipboard" ));
    copyToClipboardButton.addActionListener( (a) -> {
        Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
        defaultToolkit.getSystemClipboard().setContents( new StringSelection(stackTraceText), null );
    });
    
    JPanel p1 = new JPanel( new FlowLayout(FlowLayout.TRAILING) );
    p1.add( copyToClipboardButton );
    
    JPanel p2 = new JPanel( new BorderLayout(0, 10) );
    p2.add( infoLabel, BorderLayout.NORTH );
    p2.add( scrollPane, BorderLayout.CENTER );        
    p2.add( p1, BorderLayout.SOUTH );
    p2.setSize( new Dimension(600,400) );
    p2.setMinimumSize( p2.getSize() );
    p2.setPreferredSize( p2.getSize() );
    
    return p2;
}
 
开发者ID:chipKIT32,项目名称:chipKIT-importer,代码行数:37,代码来源:ProgressTrackingPanel.java

示例6: readFromGUI

/**
 * Ask using a GUI for the username and password.
 */
private void readFromGUI() {
   // Create fields for user name.
   final JTextField usernameField = new JTextField(20);
   usernameField.setText(this.username);
   final JLabel usernameLabel = new JLabel("Username: ");
   usernameLabel.setLabelFor(usernameField);
   final JPanel usernamePane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
   usernamePane.add(usernameLabel);
   usernamePane.add(usernameField);

   // Create fields for password.
   final JPasswordField passwordField = new JPasswordField(20);
   passwordField.setText(this.password);
   final JLabel passwordLabel = new JLabel("Password: ");
   passwordLabel.setLabelFor(passwordField);
   final JPanel passwordPane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
   passwordPane.add(passwordLabel);
   passwordPane.add(passwordField);

   // Create panel
   final JPanel main = new JPanel();
   main.setLayout(new BoxLayout(main, BoxLayout.PAGE_AXIS));
   main.add(usernamePane);
   main.add(passwordPane);

   // Create and handle dialog
   final JOptionPane jop = new JOptionPane(main, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
   final JDialog dialog = jop.createDialog("User name and password");
   dialog.addComponentListener(new ComponentAdapter() {
      
      public void componentShown(ComponentEvent e) {
         SwingUtilities.invokeLater(new Runnable() {
            
            public void run() {
               if (usernameField.getText().isEmpty())
               {
                  usernameField.requestFocusInWindow();
               }
               else
               {
                  passwordField.requestFocusInWindow();
               }
            }
         });
      }
   });
   dialog.setVisible(true);
   final Integer result = (Integer) jop.getValue();
   dialog.dispose();
   if (result.intValue() == JOptionPane.OK_OPTION) {
      this.username = usernameField.getText();

      final char[] pwd = passwordField.getPassword();
      this.password = new String(pwd);
   }
}
 
开发者ID:OpenDA-Association,项目名称:OpenDA,代码行数:59,代码来源:UsernamePassword.java

示例7: initPrintDialog

/**
 * Initialize print dialog.
 */
void initPrintDialog(int x, int y,
                     PrintService[] services,
                     int defaultServiceIndex,
                     DocFlavor flavor,
                     PrintRequestAttributeSet attributes)
{
    this.services = services;
    this.defaultServiceIndex = defaultServiceIndex;
    this.asOriginal = attributes;
    this.asCurrent = new HashPrintRequestAttributeSet(attributes);
    this.psCurrent = services[defaultServiceIndex];
    this.docFlavor = flavor;
    SunPageSelection pages =
        (SunPageSelection)attributes.get(SunPageSelection.class);
    if (pages != null) {
        isAWT = true;
    }

    Container c = getContentPane();
    c.setLayout(new BorderLayout());

    tpTabs = new JTabbedPane();
    tpTabs.setBorder(new EmptyBorder(5, 5, 5, 5));

    String gkey = getMsg("tab.general");
    int gmnemonic = getVKMnemonic("tab.general");
    pnlGeneral = new GeneralPanel();
    tpTabs.add(gkey, pnlGeneral);
    tpTabs.setMnemonicAt(0, gmnemonic);

    String pkey = getMsg("tab.pagesetup");
    int pmnemonic = getVKMnemonic("tab.pagesetup");
    pnlPageSetup = new PageSetupPanel();
    tpTabs.add(pkey, pnlPageSetup);
    tpTabs.setMnemonicAt(1, pmnemonic);

    String akey = getMsg("tab.appearance");
    int amnemonic = getVKMnemonic("tab.appearance");
    pnlAppearance = new AppearancePanel();
    tpTabs.add(akey, pnlAppearance);
    tpTabs.setMnemonicAt(2, amnemonic);

    c.add(tpTabs, BorderLayout.CENTER);

    updatePanels();

    JPanel pnlSouth = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    btnApprove = createExitButton("button.print", this);
    pnlSouth.add(btnApprove);
    getRootPane().setDefaultButton(btnApprove);
    btnCancel = createExitButton("button.cancel", this);
    handleEscKey(btnCancel);
    pnlSouth.add(btnCancel);
    c.add(pnlSouth, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            dispose(CANCEL);
        }
    });

    getAccessibleContext().setAccessibleDescription(getMsg("dialog.printtitle"));
    setResizable(false);
    setLocation(x, y);
    pack();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:69,代码来源:ServiceDialog.java

示例8: PrintJDialog

public PrintJDialog(ControlJFrame objPcontrolJFrame, PrintService[] objPprintServiceA, int intPdefaultServiceIndex) {

		// Parse parameters :
		super(objPcontrolJFrame, Strings.doConcat(Tools.getLocaleString("dialog.printtitle"), ' ', Strings.strS_ELLIPSIS), true);
		this.objGcontrolJFrame = objPcontrolJFrame;
		this.objGprintServiceA = objPprintServiceA;
		this.intGdefaultServiceIndex = intPdefaultServiceIndex;
		this.objGprintService = objPprintServiceA[intPdefaultServiceIndex];
		this.bolGvalidated = true;
		this.objGhashPrintRequestAttributeSet = new HashPrintRequestAttributeSet();

		// Set icon :
		final Image imgL = this.objGcontrolJFrame.getJuggleMasterPro().getImage(Constants.intS_FILE_ICON_PRINT, 0);
		this.setIconImage(imgL != null ? imgL : this.objGcontrolJFrame.getJuggleMasterPro().getFrame().imgGjmp);

		// Build tabbed panel :
		this.setLayout(new BorderLayout());
		final JTabbedPane objLjTabbedPane = new JTabbedPane();
		objLjTabbedPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		this.objGprintGeneralJPanel = new PrintGeneralJPanel(this);
		objLjTabbedPane.add(Strings.doConcat(Strings.strS_SPACE, Tools.getLocaleString("tab.general"), Strings.strS_SPACE),
							this.objGprintGeneralJPanel);
		this.objGprintPageSetupJPanel = new PrintPageSetupJPanel(this, objPcontrolJFrame);
		objLjTabbedPane.add(Strings.doConcat(Strings.strS_SPACE, Tools.getLocaleString("tab.pagesetup"), Strings.strS_SPACE),
							this.objGprintPageSetupJPanel);
		this.objGprintAppearanceJPanel = new PrintAppearanceJPanel(this, objPcontrolJFrame);
		objLjTabbedPane.add(Strings.doConcat(Strings.strS_SPACE, Tools.getLocaleString("tab.appearance"), Strings.strS_SPACE),
							this.objGprintAppearanceJPanel);
		this.add(objLjTabbedPane, BorderLayout.CENTER);
		this.updatePanels();

		// Add OK and cancel buttons :
		final JPanel objLbuttonsJPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
		objLbuttonsJPanel.setOpaque(true);
		this.objGoKJButton = new ExtendedJButton(this.objGcontrolJFrame, Tools.getLocaleString("button.print"));
		this.objGoKJButton.addActionListener(this);

		objLbuttonsJPanel.add(this.objGoKJButton);
		this.getRootPane().setDefaultButton(this.objGoKJButton);
		final ExtendedJButton objLcancelJButton = new ExtendedJButton(this.objGcontrolJFrame, Tools.getLocaleString("button.cancel"));
		objLcancelJButton.addActionListener(this);
		objLbuttonsJPanel.add(objLcancelJButton);
		this.add(objLbuttonsJPanel, BorderLayout.SOUTH);

		this.addWindowListener(new JDialogWindowListener(this.objGcontrolJFrame, this, false));
		this.setResizable(false);
		this.validate();
		this.pack();
		this.objGcontrolJFrame.setWindowBounds(this, this.objGcontrolJFrame, true);
	}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:50,代码来源:PrintJDialog.java

示例9: initPageDialog

/**
 * Initialize "page setup" dialog
 */
void initPageDialog(int x, int y,
                     PrintService ps,
                     DocFlavor flavor,
                     PrintRequestAttributeSet attributes)
{
    this.psCurrent = ps;
    this.docFlavor = flavor;
    this.asOriginal = attributes;
    this.asCurrent = new HashPrintRequestAttributeSet(attributes);

    if (attributes.get(DialogOnTop.class) != null) {
        setAlwaysOnTop(true);
    }

    Container c = getContentPane();
    c.setLayout(new BorderLayout());

    pnlPageSetup = new PageSetupPanel();
    c.add(pnlPageSetup, BorderLayout.CENTER);

    pnlPageSetup.updateInfo();

    JPanel pnlSouth = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    btnApprove = createExitButton("button.ok", this);
    pnlSouth.add(btnApprove);
    getRootPane().setDefaultButton(btnApprove);
    btnCancel = createExitButton("button.cancel", this);
    handleEscKey(btnCancel);
    pnlSouth.add(btnCancel);
    c.add(pnlSouth, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            dispose(CANCEL);
        }
    });

    getAccessibleContext().setAccessibleDescription(getMsg("dialog.pstitle"));
    setResizable(false);
    setLocation(x, y);
    pack();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:45,代码来源:ServiceDialog.java


注:本文中的java.awt.FlowLayout.TRAILING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。