public BallerinaModuleSettingsUI(@NotNull Module module, boolean dialogMode) { myPanel.setPreferredSize(new Dimension(400, -1)); }
JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); frame.setSize(200, 200); // create the status bar panel and shove it down the bottom of the frame JPanel statusPanel = new JPanel(); statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED)); frame.add(statusPanel, BorderLayout.SOUTH); statusPanel.setPreferredSize(new Dimension(frame.getWidth(), 16)); statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.X_AXIS)); JLabel statusLabel = new JLabel("status"); statusLabel.setHorizontalAlignment(SwingConstants.LEFT); statusPanel.add(statusLabel); frame.setVisible(true);
@PostConstruct public void init() { browserPanel.add(browserView.asUIComponent(), BorderLayout.CENTER); browserPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 5)); browserPanel.setPreferredSize(new Dimension(250, 250)); browserPanel.setMinimumSize(new Dimension(250, 250)); infoPanel.add(deviceInfosView.asUIComponent(), BorderLayout.CENTER); infoPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); infoPanel.setPreferredSize(new Dimension(675, 200)); infoPanel.setMinimumSize(new Dimension(650, 200)); eastWestSplitPane.setBorder(BorderFactory.createEmptyBorder()); eastWestSplitPane.setResizeWeight(0); eastWestSplitPane.setLeftComponent(browserPanel); eastWestSplitPane.setRightComponent(infoPanel); northSouthSplitPane.setBorder(BorderFactory.createEmptyBorder()); northSouthSplitPane.setResizeWeight(0.8); northSouthSplitPane.setTopComponent(eastWestSplitPane); northSouthSplitPane.setBottomComponent(logView.asUIComponent()); add(toolbarView.asUIComponent(), BorderLayout.NORTH); add(northSouthSplitPane, BorderLayout.CENTER); setSize(new Dimension(975, 700)); setMinimumSize(new Dimension(975, 450)); setResizable(true); }
this.setSize(new Dimension(frameWidth, frameHeight)); softeningSlider.setPreferredSize(new Dimension(200, 30)); this.trackPanelGraphics = this.trackPanel.getGraphics(); this.toolsPanel = new JPanel(); this.toolsPanel.setBackground(Color.darkGray); this.toolsPanel.setLayout(new GridLayout(1, 3)); JPanel feedbackSettingsPanel = new JPanel(); feedbackSettingsPanel.setBorder(BorderFactory.createTitledBorder("feedback: " )); JPanel sliderPanel = new JPanel(); sliderPanel.setLayout(new BoxLayout(sliderPanel, BoxLayout.X_AXIS)); sliderPanel.add(sliderMin); sliderPanel.add(sliderMax); sliderPanel.setPreferredSize(new Dimension(60, 600)); sliderMin.setPreferredSize(new Dimension(30, 600)); sliderMax.setPreferredSize(new Dimension(30, 600)); displaySettingsPanel.add(sliderPanel, BorderLayout.CENTER); JPanel softeningPanel = new JPanel(); softeningPanel.setLayout(new BoxLayout(softeningPanel, BoxLayout.Y_AXIS));
JFrame jf = new JFrame(); JPanel jp = new JPanel(); jp.setPreferredSize(new Dimension(400,800));// changed it to preferredSize, Thanks! jf.getContentPane().add( jp );// adding to content pane will work here. Please read the comment bellow. jf.pack();
int frameWidth = 1200; JFrame frame = new JFrame("GraphHopper UI - Small&Ugly ;)"); frame.setLayout(new BorderLayout()); frame.add(mainPanel, BorderLayout.CENTER); frame.add(infoPanel, BorderLayout.NORTH); infoPanel.setPreferredSize(new Dimension(300, 100));
private AddKeyDialog(MongoEditionPanel mongoEditionPanel) { super(mongoEditionPanel); mainPanel.setPreferredSize(GuiUtils.enlargeWidth(mainPanel.getPreferredSize(), 1.5d)); valuePanel.setLayout(new BorderLayout()); nameTextfield.setName("keyName"); typeCombobox.setName("valueType"); }
@Nullable @Override protected JComponent createCenterPanel() { JPanel panel = new JPanel(new BorderLayout()); panel.add(createNamePanel(), BorderLayout.CENTER); if (myOccurrencesCount > 1) panel.add(createReplaceAllPanel(), BorderLayout.SOUTH); panel.setPreferredSize(new Dimension(myNameField.getWidth(), -1)); return panel; }
@Override public JPanel getPanel() { if (view != null) { return view.getPanel(); } JPanel panel = new JPanel(); panel.setPreferredSize(new Dimension(300, 500)); return panel; } }
public GoModuleSettingsUI(@NotNull Module module, boolean dialogMode) { if (dialogMode) { myPanel.setPreferredSize(new Dimension(400, -1)); } myVendoringUI.initPanel(module); myBuildTagsUI.initPanel(module); }
statusIconButton.setFocusable(false); statusIconPanel.setPreferredSize(new Dimension(150, 200)); statusIconPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); statusIconPanel.add(statusIconButton); statusIconPanel.add(fullscreenCheckbox); getLogPanel().setPreferredSize(new Dimension(800, 175)); getView().setMinimumSize(new Dimension(150, 200)); getView().add(statusIconPanel, BorderLayout.WEST); getView().add(getLogPanel(), BorderLayout.CENTER);
content.setLayout(new BorderLayout()); JSplitPane verticalSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, inputAndMatchesPanel, displayMatchesPanel); verticalSplit.setResizeWeight(.2); if (screenSize.height > 800) { screenSize.height = 800; } setPreferredSize(screenSize); Dimension displayMatchesSize = new Dimension((int) (screenSize.getWidth()),(int) (screenSize.getHeight()*3/4.)); displayMatchesPanel.setPreferredSize(displayMatchesSize);
JPanel panel = new JPanel(); panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); contentPanel.add(panel,new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); JPanel spacer = new JPanel(); spacer.setPreferredSize(new Dimension()); contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
JPanel test = new JPanel(); test.setPreferredSize(new Dimension( 2000,2000)); JScrollPane scrollFrame = new JScrollPane(test); test.setAutoscrolls(true); scrollFrame.setPreferredSize(new Dimension( 800,300)); this.add(scrollFrame);
private void contract() { if (pluginPanel == null) { return; } pluginPanel.onDeactivate(); navContainer.setMinimumSize(new Dimension(0, 0)); navContainer.setMaximumSize(new Dimension(0, 0)); navContainer.setPreferredSize(new Dimension(0, 0)); navContainer.revalidate(); giveClientFocus(); frame.contractBy(pluginPanel.getWrappedPanel().getPreferredSize().width); pluginPanel = null; }
JPanel panel = new JPanel(); panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); contentPanel.add(panel,new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); JPanel spacer = new JPanel(); spacer.setPreferredSize(new Dimension()); contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
final JScrollPane scrollPane = new JScrollPane(table); scrollPane.setBorder(BorderFactory.createTitledBorder("Events: ")); scrollPane.setPreferredSize(new Dimension(900, 300)); details.setPreferredSize(new Dimension(900, 300));
contentPanel.add(label, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); contentPanel.add(shapeCombo, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); contentPanel.add(edgesLabel, new GridBagConstraints(2, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 0, 6), 0, 0)); JPanel spacer = new JPanel(); spacer.setPreferredSize(new Dimension()); contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
public GoSdkConfigurable(@NotNull Project project, boolean dialogMode) { myProject = project; if (dialogMode) { myComponent.setPreferredSize(new Dimension(400, -1)); } FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle("Select GOROOT"); mySdkPathField.addBrowseFolderListener(myProject, new MyBrowseFolderListener(chooserDescriptor)); listenForPathUpdate(); Disposer.register(myDisposable, mySdkPathField); }
contentPanel.add(label, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); contentPanel.add(shapeCombo, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); contentPanel.add(edgesLabel, new GridBagConstraints(2, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 0, 6), 0, 0)); JPanel spacer = new JPanel(); spacer.setPreferredSize(new Dimension()); contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));