Package javax.swing.border

Examples of javax.swing.border.LineBorder


    public static MatteBorder createMatteBorder(final int top, final int left, final int bottom, final int right, final Color color) {
        return new MatteBorder(top, left, bottom, right, color);
    }

    public static Border createLineBorder(final Color color, final int thickness) {
        return new LineBorder(color, thickness);
    }
View Full Code Here


    public static Border createLineBorder(final Color color, final int thickness) {
        return new LineBorder(color, thickness);
    }

    public static Border createLineBorder(final Color color) {
        return new LineBorder(color);
    }
View Full Code Here

    enablePosixGroups.setEnabled(false);

    //put into 3.2.x functionality row
    JPanel jon32xRegion = new JPanel();
    jon32xRegion.setLayout(new FlowLayout(FlowLayout.LEFT));
    LineBorder jon32xLineBorder = new LineBorder(Color.BLACK, 2);
    TitledBorder jon32xBorder = new TitledBorder(jon32xLineBorder, "JON 3.2.x/RHQ 4.8.x specific features:");
    jon32xRegion.setBorder(jon32xBorder);
    enable32xFeatures= new JCheckBox("enable JON 3.2.x/RHQ 4.8.x features");
    enable32xFeatures.setToolTipText("This enables features not available before RHQ 4.8.x/JON 3.2.x.");
    enable32xFeatures.setSelected(false);
    enable32xFeatures.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(ItemEvent e) {
        if(enable32xFeatures.isSelected()){
          groupPageSizeName.setEnabled(true);
          groupMemberQueryValue.setEnabled(true);
          groupMemberQueryValue.setEditable(true);
          groupMemberQueryValue.setText("1000");
          enablePosixGroups.setEnabled(true);
        }else{
          groupMemberQueryValue.setText("");
          groupPageSizeName.setEnabled(false);
          groupMemberQueryValue.setEnabled(false);
          groupMemberQueryValue.setEditable(false);
          enablePosixGroups.setEnabled(false);
          enablePosixGroups.setSelected(false);
        }
      }
    });

    jon32xRegion.add(enable32xFeatures);
    groupPageSizeName = new JLabel("Group Query Page Size:");
    groupPageSizeName.setEnabled(false);
    groupMemberQueryValue = new JTextField(10);
    groupMemberQueryValue.setText("1000");
    groupMemberQueryValue.setEditable(false);
    jon32xRegion.add(groupPageSizeName);
    jon32xRegion.add(groupMemberQueryValue);
    jon32xRegion.add(enablePosixGroups);
    top.add(jon32xRegion);
   
    //put into row display
    JPanel advancedDebugRegion = new JPanel();
    advancedDebugRegion.setLayout(new FlowLayout(FlowLayout.LEFT));
    LineBorder advancedBorder = new LineBorder(Color.BLACK, 2);
    TitledBorder debugBorder = new TitledBorder(advancedBorder, "Debug: **Warning --<hover HERE>**");
    advancedDebugRegion.setBorder(debugBorder);
    advancedDebugRegion.add(enableLdapReferral);
    advancedDebugRegion.add(enableVerboseDebugging);
    advancedDebugRegion.add(enableVerboseGroupParsing);
    advancedDebugRegion.add(iterativeVerboseLogging);
    advancedDebugRegion.setToolTipText(warnMessage);
    top.add(advancedDebugRegion);

    JPanel securityPanel = new JPanel();
    securityPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    showPasswords.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(ItemEvent e) {
        SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
          //store off existing value
          String existingValue = "";
          String existingTestUserPass = "";
          JTextField current = fieldMappings.get("Password:");
          if(current instanceof JPasswordField){
            JPasswordField pass = ((JPasswordField)current);
            if(pass!=null){
              char[] charArray = pass.getPassword();
              if(charArray.length>0){
              existingValue = new String(charArray);
              }
            }
          }else{
            existingValue = current.getText();
          }
          //save off test user password as well
          if(testUserPasswordValue instanceof JPasswordField){
            JPasswordField pass = ((JPasswordField)testUserPasswordValue);
            if(pass!=null){
              char[] charArray = pass.getPassword();
              if(charArray.length>0){
              existingTestUserPass = new String(charArray);
              }
            }
          }else{
            existingTestUserPass=testUserPasswordValue.getText();
          }
         
          JTextField updatedContainer = null;
          if(showPasswords.isSelected()){
            updatedContainer = new JTextField(textBoxWidth);
            updatedContainer.setText(existingValue);
            testUserPasswordValue = new JTextField(textBoxWidth);
            testUserPasswordValue.setText(existingTestUserPass);
          }else{
            updatedContainer = new JPasswordField(textBoxWidth);
            updatedContainer.setText(existingValue);
            testUserPasswordValue = new JPasswordField(textBoxWidth);
            testUserPasswordValue.setText(existingTestUserPass);
          }
          //locate the JPanel and rebuild it Should be at index 3
          JPanel passwordRow = (JPanel) top.getComponent(3);
//          JTextField jf = (JTextField) passwordRow.getComponent(1);
          //store off existing components
          Component[] existing = new Component[passwordRow.getComponentCount()];
          for(int i=0; i<passwordRow.getComponentCount();i++){
            existing[i] = passwordRow.getComponent(i);
          }
          passwordRow.removeAll();
          for(int j=0;j<existing.length;j++){
            if(j==1){//insert new JTextField instead
              passwordRow.add(updatedContainer);
            }else{
              passwordRow.add(existing[j]);
            }
          }
          //reload testUserRegion
          //store off existing components
          Component[] existingTest = new Component[testUserRegion.getComponentCount()];
          for(int i=0; i<testUserRegion.getComponentCount();i++){
            existingTest[i] = testUserRegion.getComponent(i);
          }
          testUserRegion.removeAll();
          for(int j=0;j<existingTest.length;j++){
            if(j==3){//insert new JTextField instead
              testUserRegion.add(testUserPasswordValue);
            }else{
              testUserRegion.add(existingTest[j]);
            }
          }
         
          top.revalidate();
          top.repaint();
        }
      })
      }
    });
    securityPanel.add(showPasswords);
    ssl = new JCheckBox("SSL:");
    ssl.setEnabled(false);
    securityPanel.add(ssl);
    top.add(securityPanel);
   
    // test user auth region
    testUserRegion = new JPanel();
    testUserRegion.setLayout(new FlowLayout(FlowLayout.LEFT));
    LineBorder border = new LineBorder(Color.BLUE, 2);
    TitledBorder tBorder = new TitledBorder(border, "Authentication/Authorization Check Credentials: (insert valid ldap user assigned to group)");
    testUserRegion.setBorder(tBorder);
    JLabel testUserName = new JLabel("Test UserName:");
    testUserNameValue = new JTextField(textBoxWidth);
    JLabel testUserPassword = new JLabel("Test Password:");
View Full Code Here

        panel.setBorder(new TitledBorder(new EtchedBorder(), "Text"));
        text_field_ = new JTextField("Preview Font");
        text_field_.setBackground(Color.white);
        text_field_.setForeground(Color.black);
        text_field_.setOpaque(true);
        text_field_.setBorder(new LineBorder(Color.black));
        text_field_.setPreferredSize(new Dimension(120, 40));
        panel.add(text_field_, BorderLayout.CENTER);

        return panel;
    }
View Full Code Here

    // Liste
    list = getSavegameList();
    list.setBackground(new Color(170, 71, 12, 255));
    list.setForeground(new Color(236, 182, 74, 255));
    list.setFont(new Font("Dialog", Font.PLAIN, 15));
    list.setBorder(new LineBorder(new Color(236, 182, 74, 255)));
    list.setPreferredSize(new Dimension(xSizeList, ySizeList));
    list.setBounds(40, 70, xSizeList, ySizeList);
    background.add(list);
    // Buttons
    loadButton = new DialogButton("", Images.getDialogLoadButtonDefaultImage(), Images.getDialogLoadButtonRolloverImage(), Images.getDialogLoadButtonPressedImage(), Images.getDialogLoadButtonDisabledImage());
View Full Code Here

    list.setVisible(false);
    list = getSavegameList();
    list.setBackground(new Color(170, 71, 12, 255));
    list.setForeground(new Color(236, 182, 74, 255));
    list.setFont(new Font("Dialog", Font.PLAIN, 15));
    list.setBorder(new LineBorder(new Color(236, 182, 74, 255)));
    list.setPreferredSize(new Dimension(xSizeList, ySizeList));
    list.setBounds(40, 70, xSizeList, ySizeList);
    background.add(list);
  }
View Full Code Here

    hasNullBorder.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if (hasNullBorder.isSelected())
          sp.setBorder(null);
        else
          sp.setBorder(new LineBorder(Color.red));
        sp.repaint();
      }
    });
    builder.append("Border", hasNullBorder);
View Full Code Here

            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });

        jList1.setVisibleRowCount(4);
        jList1.setBorder(new LineBorder(Color.GRAY));
        jTextArea1.setLineWrap(true);
    jTextArea1.setWrapStyleWord(true);
    jTextArea1.setBorder(new LineBorder(Color.GRAY));
        jComboBox1.setModel(new DefaultComboBoxModel(new String[] {"Text in ComboBox"}));
        jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0));

    add(jLabel1,       "split, span");
    add(jTextField1,   "");
View Full Code Here

  {
    JTabbedPane tabbedPane = new JTabbedPane();

    // "NON"-corrected bounds
    JPanel p1 = createTabPanel(new MigLayout("fill, ins 3, novisualpadding"));
    p1.setBorder(new LineBorder(Color.BLACK));

    JTabbedPane demoPane2 = new JTabbedPane();
    JPanel demoPanel2 = new JPanel();
    demoPanel2.setBackground(Color.WHITE);
    demoPane2.addTab("Demo Tab", demoPanel2);

    p1.add(createTextArea("A JTextArea", 1, 100), "grow, aligny bottom, wmin 100");
    p1.add(demoPane2, "grow, aligny bottom");
    p1.add(createTextField("A JTextField", 100), "grow, aligny bottom, wmin 100");
    p1.add(createTextArea("A JTextArea", 1, 100), "newline,grow, aligny bottom, wmin 100");
    p1.add(createTextArea("A JTextArea", 1, 100), "grow, aligny bottom, wmin 100");
    p1.add(createTextArea("A JTextArea", 1, 100), "grow, aligny bottom, wmin 100");

    JPanel p2 = createTabPanel(new MigLayout("center,center,fill,ins 3"));
    p2.setBorder(new LineBorder(Color.BLACK));

    JTabbedPane demoPane = new JTabbedPane();
    JPanel demoPanel = new JPanel();
    demoPanel.setBackground(Color.WHITE);
    demoPane.addTab("Demo Tab", demoPanel);
View Full Code Here

    // Bounds tab
    JPanel boundsPanel = createTabPanel(new MigLayout());

    String constr = "pos (visual.x+visual.w*0.1) visual.y2-40 (visual.x2-visual.w*0.1) visual.y2";
    JLabel southLabel = createLabel(constr, SwingConstants.CENTER);
    southLabel.setBorder(new LineBorder(Color.LIGHT_GRAY, 1));
    southLabel.setBackground(new Color(200, 200, 255, benchRuns == 0 ? 70 : 255));
    southLabel.setOpaque(true);
    southLabel.setFont(southLabel.getFont().deriveFont(Font.BOLD));
    boundsPanel.add(southLabel, constr);

View Full Code Here

TOP

Related Classes of javax.swing.border.LineBorder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.