private JPanel createInfoPanel(String text) { JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(new EmptyBorder(7, 8, 6, 8)); panel.setBackground(ColorScheme.DARK_GRAY_COLOR); JLabel infoLabel = new JShadowedLabel(text); infoLabel.setForeground(ColorScheme.LIGHT_GRAY_COLOR.darker()); infoLabel.setFont(FontManager.getRunescapeSmallFont()); panel.add(infoLabel); return panel; }
final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); getContentPane().setLayout(new BorderLayout()); getContentPane().add(mainPanel, BorderLayout.CENTER); mainPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
private JPanel buildPingField() { JPanel column = new JPanel(new BorderLayout()); column.setBorder(new EmptyBorder(0, 5, 0, 5)); pingField = new JLabel("-"); pingField.setFont(FontManager.getRunescapeSmallFont()); column.add(pingField, BorderLayout.EAST); return column; }
private void initializeComponents () { getContentPane().setLayout(new GridBagLayout()); JPanel leftSidePanel = new JPanel(); leftSidePanel.setLayout(new GridBagLayout()); getContentPane().add(leftSidePanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); JPanel fontPanel = new JPanel(); fontPanel.add(new JLabel("Size:"), new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0)); bitmapPanel.add(new JLabel("Gamma:"), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); fontPanel.add(new JLabel("Rendering:"), new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); wrapperPanel.setLayout(new BorderLayout()); gamePanel.setLayout(new BorderLayout()); getContentPane().add(rightSidePanel, new GridBagConstraints(1, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); appliedEffectsScroll.setBorder(new EmptyBorder(0, 0, 0, 0)); appliedEffectsScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
@Override public void run () { JPanel panel = new JPanel(new FlowLayout()); JPanel textPanel = new JPanel() { public boolean isOptimizedDrawingEnabled () { return false; }; textPanel.setLayout(new OverlayLayout(textPanel)); panel.add(textPanel); textPanel.add(textField); final JLabel placeholderLabel = new JLabel(hint); placeholderLabel.setForeground(Color.GRAY); placeholderLabel.setAlignmentX(0.0f); textPanel.add(placeholderLabel, 0); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField)));
JLabel l = new JLabel(text, alignment); l.setBorder(new LineBorder(Color.RED, 2)); return l; SwingUtilities.invokeLater(new Runnable() { public void run() { JPanel p = new JPanel(new GridLayout(2,2,4,4)); p.setBackground(Color.black); p.setBorder(new EmptyBorder(4,4,4,4)); JPanel border = new JPanel(new BorderLayout()); border.add(getLabel( "Border", SwingConstants.CENTER), BorderLayout.CENTER); p.add(border); JPanel gridbag = new JPanel(new GridBagLayout()); gridbag.add(getLabel("GridBag")); p.add(gridbag); p.add(box); JFrame f = new JFrame("Streeeetch me.."); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setContentPane(p); f.pack(); f.setLocationByPlatform(true); f.setVisible(true);
JFrame f = new JFrame(); f.setSize(500, 500); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel total = new JPanel(new BorderLayout()); total.setSize(f.getWidth(), f.getHeight()); total.setBackground(Color.green); total.setBorder(new EmptyBorder(100, 200, 100, 200)); JPanel box = new JPanel(); box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS)); box.add(new JButton("test")); box.add(new JLabel("hey")); total.add(box); f.add(total); f.setVisible(true);
private JComponent createNamePanel( final String name, final JComponent namedLabel ) { final JPanel panel = new JPanel( new BorderLayout( 10, 10 ) ); panel.setBorder( new EmptyBorder( 2, 10, 2, 10 ) ); final JLabel label = new JLabel( name ); label.setPreferredSize( new Dimension( 90, 20 ) ); label.setHorizontalAlignment( SwingConstants.TRAILING ); final Border emptyBorder = new EmptyBorder( 0, 10, 0, 0 ); final Border border = new CompoundBorder( UIManager.getLookAndFeelDefaults().getBorder( "TextField.border" ), emptyBorder ); namedLabel.setBorder( border ); panel.add( label, BorderLayout.WEST ); panel.add( namedLabel, BorderLayout.CENTER ); return panel; }
this.skill = skill; setLayout(new BorderLayout()); setBorder(new EmptyBorder(5, 0, 0, 0)); container.setLayout(new BorderLayout()); container.setBackground(ColorScheme.DARKER_GRAY_COLOR); popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5)); popupMenu.add(openXpTracker); popupMenu.add(reset); popupMenu.add(pauseSkill); headerPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); headerPanel.setLayout(new BorderLayout()); statsPanel.setLayout(new DynamicGridLayout(2, 2)); statsPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); statsPanel.setBorder(new EmptyBorder(9, 2, 9, 2)); expGained.setFont(FontManager.getRunescapeSmallFont()); progressWrapper.setBackground(ColorScheme.DARKER_GRAY_COLOR); progressWrapper.setLayout(new BorderLayout()); progressWrapper.setBorder(new EmptyBorder(0, 7, 7, 7));
public ClassListItem(Class<? extends T1> clz) { this.clz = clz; }
} catch (Exception e) { } EmptyBorder emptyBorder = new EmptyBorder(5, 5, 5, 5); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; stopButton.setIcon(new ImageIcon(stopIcon)); } catch (Exception ignored) { } JPanel ripPanel = new JPanel(new GridBagLayout()); ripPanel.setBorder(emptyBorder); gbc.gridx = 0; ripPanel.add(new JLabel("URL:", JLabel.RIGHT), gbc); gbc.weightx = 1; gbc.weighty = 1; gbc.weightx = 1; statusLabel = new JLabel(rb.getString("inactive")); statusLabel.setHorizontalAlignment(JLabel.CENTER); openButton = new JButton(); openButton.setVisible(false); gbc.gridy = 0; pane.add(ripPanel, gbc); gbc.gridy = 1; pane.add(statusPanel, gbc); gbc.gridy = 2; pane.add(progressPanel, gbc); gbc.gridy = 3; pane.add(optionsPanel, gbc); gbc.weighty = 1;
private JTextField addComponent(String label) { final JPanel container = new JPanel(); container.setLayout(new BorderLayout()); final JLabel uiLabel = new JLabel(label); final FlatTextField uiInput = new FlatTextField(); uiInput.setBackground(ColorScheme.DARKER_GRAY_COLOR); uiInput.setHoverBackgroundColor(ColorScheme.DARK_GRAY_HOVER_COLOR); uiInput.setBorder(new EmptyBorder(5, 7, 5, 7)); uiLabel.setFont(FontManager.getRunescapeSmallFont()); uiLabel.setBorder(new EmptyBorder(0, 0, 4, 0)); uiLabel.setForeground(Color.WHITE); container.add(uiLabel, BorderLayout.NORTH); container.add(uiInput, BorderLayout.CENTER); add(container); return uiInput.getTextField(); } }
getContentPane().add(bp); validate(); super(new BorderLayout()); e.printStackTrace(); setPreferredSize( new Dimension(300,300) ); JPanel options = new JPanel(); BoxLayout bl = new BoxLayout(options,BoxLayout.Y_AXIS); options.setLayout(bl); JPanel pFPW = new JPanel( new BorderLayout() ); frequency = new JLabel(); play.setBorder( new EmptyBorder(4,4,4,4) ); float freq = getFrequency(); if (harmonic.isSelected()) { frequency.setText( decimalFormat.format(freq) + "(/" + ") Hz" ); } else { frequency.setText( decimalFormat.format(freq) + " Hz" );
GrandExchangeOffersPanel() { setLayout(new BorderLayout()); setBackground(ColorScheme.DARK_GRAY_COLOR); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.weightx = 1; constraints.gridx = 0; constraints.gridy = 0; /* This panel wraps the offers panel and limits its height */ JPanel offersWrapper = new JPanel(new BorderLayout()); offersWrapper.setBackground(ColorScheme.DARK_GRAY_COLOR); offersWrapper.add(offerPanel, BorderLayout.NORTH); offerPanel.setLayout(new GridBagLayout()); offerPanel.setBorder(new EmptyBorder(10, 10, 10, 10)); offerPanel.setBackground(ColorScheme.DARK_GRAY_COLOR); /* This panel wraps the error panel and limits its height */ JPanel errorWrapper = new JPanel(new BorderLayout()); errorWrapper.setBackground(ColorScheme.DARK_GRAY_COLOR); /* The error panel, this displays an error message */ PluginErrorPanel errorPanel = new PluginErrorPanel(); errorWrapper.add(errorPanel, BorderLayout.NORTH); errorPanel.setBorder(new EmptyBorder(50, 20, 20, 20)); errorPanel.setContent("No offers detected", "No grand exchange offers were found on your account."); container.add(offersWrapper, OFFERS_PANEL); container.add(errorWrapper, ERROR_PANEL); add(container, BorderLayout.CENTER); resetOffers(); }
private JPanel makeSkillPanel(HiscoreSkill skill) { JLabel label = new JLabel(); label.setFont(FontManager.getRunescapeSmallFont()); label.setText("--"); String skillName = (skill == null ? "combat" : skill.getName().toLowerCase()); String directory = "/skill_icons"; if (skillName.equals("combat") || skillName.equals("overall")) { // Cannot use SpriteManager as HiscorePlugin loads before a Client is available directory += "/"; } else { directory += "_small/"; } String skillIcon = directory + skillName + ".png"; log.debug("Loading skill icon from {}", skillIcon); label.setIcon(new ImageIcon(ImageUtil.getResourceStreamFromClass(getClass(), skillIcon))); boolean totalLabel = skill == HiscoreSkill.OVERALL || skill == null; //overall or combat label.setIconTextGap(totalLabel ? 10 : 4); JPanel skillPanel = new JPanel(); skillPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); skillPanel.setBorder(new EmptyBorder(2, 0, 2, 0)); skillLabels.add(label); skillPanel.add(skillLabels.get(skillLabels.size() - 1)); return skillPanel; }
private JPanel createOutputPanel() { JPanel outputPanel = new JPanel(); outputPanel.setLayout(new BorderLayout(0, 0)); new FileDrop<Container>(outputPanel, null, dropListener); this.instructionLabel = new JLabel(""); this.instructionLabel.setIcon(this.blueArrowSmall); this.instructionLabel.setBorder(new EmptyBorder(4, 4, 4, 4)); this.instructionLabel.addMouseListener(new MouseAdapter() { @Override
JPanel fontTable = new JPanel(new BorderLayout(3, 1)); JPanel fontNameCol = new JPanel(new GridLayout(0, 1, 2, 2)); JPanel fontExampleCol = new JPanel(new GridLayout(0, 1, 2, 2)); fontTable.add(fontNameCol, BorderLayout.WEST); fontTable.add(fontExampleCol, BorderLayout.CENTER); for (int ii = 0; ii < fonts.length; ii++) { fontNameCol.add(new JLabel(fonts[ii])); fontExampleCol.add(getExampleOfFont(fonts[ii])); JPanel p = new JPanel(new BorderLayout()); p.setBorder(new EmptyBorder(border, border, border, border)); p.add(tabPane, BorderLayout.CENTER); p.setPreferredSize(new Dimension(400, 400)); JFrame f = new JFrame("Properties"); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f.getContentPane().add(p, BorderLayout.CENTER); f.pack(); f.setMinimumSize(f.getPreferredSize()); f.setSize(600, 500); f.setLocationRelativeTo(null); f.setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(new BorderLayout()); setSize(100, 200); inputDisplay = new JLabel(); inputDisplay.setHorizontalAlignment(JLabel.RIGHT); inputDisplay.setText(Integer.toString(leftHandSide)); operatorIndicator = new JLabel(); operatorIndicator.setBorder(new EmptyBorder(0, 4, 0, 4)); final JPanel digitPanel = new JPanel(); digitPanel.setLayout(new GridLayout(4,3)); final int[] digitKeyOrder = new int[] { 7,8,9,4,5,6,1,2,3 }; digitPanel.add(new JButton(new DigitButtonAction(digit))); digitPanel.add(new JPanel()); // Blank spacer panel digitPanel.add(new JButton(new DigitButtonAction(0))); add(display, BorderLayout.NORTH); pack(); @Override public void run() { new CalculatorDemo().setVisible(true);
public void init() setLayout(new BorderLayout()); setBorder(new EmptyBorder(10, 10, 10, 10)); JPanel northPanel = new JPanel(new BorderLayout()); northPanel.setBorder(new EmptyBorder(1, 0, 10, 0)); title.setText("Screen Markers"); title.setForeground(Color.WHITE); northPanel.add(title, BorderLayout.WEST); northPanel.add(addMarker, BorderLayout.EAST); title.setVisible(false);
mainLayout = new BorderLayout(0,0); gui = new JPanel(mainLayout); gui.setBackground(Color.RED); border = new EmptyBorder(0,0,0,0); tree.expandRow(ii); JPanel buttonPanel = new JPanel(buttonLayout); gui.add(buttonPanel, BorderLayout.PAGE_START); mainLayout.setHgap(hGap); mainLayout.setVgap(vGap); buttonLayout.setHgap(hGap); gui.setBorder(new EmptyBorder(vBorder,hBorder,vBorder,hBorder)); Container c = gui.getTopLevelAncestor(); if (c instanceof Window) { Window w = (Window)c; w.pack(); JFrame f = new JFrame("White (OK Red) Space"); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f.setLocationByPlatform(true); f.pack();