Java Code Examples for com.alee.laf.panel.WebPanel#setLayout()
The following examples show how to use
com.alee.laf.panel.WebPanel#setLayout() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShortcutInfoPanel.java From lnk2pwn with MIT License | 6 votes |
private WebPanel createShortcutDetailsPanel() { MigLayout layout = new MigLayout("", "[grow][grow][grow][][grow]", ""); WebPanel panel = new WebPanel(); panel.setLayout(layout); panel.add(new WebLabel("File Name")); panel.add(new WebLabel("Fake Extension")); panel.add(new WebLabel("Icon Location")); panel.add(new WebLabel("Icon Index")); panel.add(new WebLabel("Window Style"), "wrap"); panel.add(shortcutFileNameField, "grow"); panel.add(fakeExtensionField, "grow"); panel.add(iconPathField, "grow"); panel.add(iconIndexField, "grow"); panel.add(windowStyleComboBox, "grow"); return panel; }
Example 2
Source File: UACBypassPanel.java From lnk2pwn with MIT License | 6 votes |
private WebPanel createUACCommandPanel() { MigLayout layout = new MigLayout("", "[grow][grow]", "[][grow]"); WebPanel panel = new WebPanel(); panel.setLayout(layout); panel.add(new WebLabel("Command")); panel.add(new WebLabel("Output"), "wrap"); uacCommandTextArea.setLineWrap(true); uacCommandTextArea.setBackground(COMMAND_BG_COLOR); uacCommandTextArea.setForeground(Color.WHITE); uacOuputTextArea.setLineWrap(true); uacOuputTextArea.setBackground(COMMAND_BG_COLOR); uacOuputTextArea.setForeground(Color.WHITE); WebScrollPane uacCommandAreaScroll = new WebScrollPane(uacCommandTextArea); WebScrollPane uacOuputAreaScroll = new WebScrollPane(uacOuputTextArea); panel.add(uacCommandAreaScroll, "w 100%, h 100%, hmin 250"); panel.add(uacOuputAreaScroll, "w 100%, h 100%, hmin 250"); return panel; }
Example 3
Source File: ShortcutInfoPanel.java From lnk2pwn with MIT License | 5 votes |
private WebPanel createTargetPathAndWorkingDirPanel() { MigLayout layout = new MigLayout("", "[grow][grow]", ""); WebPanel panel = new WebPanel(); panel.setLayout(layout); panel.add(new WebLabel("Target Path")); panel.add(new WebLabel("Working Dir"), "wrap"); panel.add(targetPathField, "grow"); panel.add(workingDirField, "grow"); return panel; }
Example 4
Source File: ShortcutInfoPanel.java From lnk2pwn with MIT License | 5 votes |
private WebPanel createArgumentsPanel() { MigLayout layout = new MigLayout("", "[grow]", ""); WebPanel panel = new WebPanel(); panel.setLayout(layout); panel.add(new WebLabel("Arguments"), "wrap"); panel.add(argumentsField, "grow"); return panel; }
Example 5
Source File: UACBypassPanel.java From lnk2pwn with MIT License | 5 votes |
private WebPanel createUACFileNamePanel() { MigLayout layout = new MigLayout("", "[grow]", ""); WebPanel panel = new WebPanel(); panel.setLayout(layout); panel.add(new WebLabel("File Name(.vbs)"), "wrap"); panel.add(uacFileNameField, "grow"); return panel; }
Example 6
Source File: FormPanel.java From lnk2pwn with MIT License | 5 votes |
private WebPanel createGenerateButtonPanel() { MigLayout layout = new MigLayout("", "[grow]", ""); WebPanel panel = new WebPanel(); panel.setLayout(layout); panel.add(generateButton, "east"); return panel; }
Example 7
Source File: GridEffectDialog.java From Spade with GNU General Public License v3.0 | 5 votes |
public GridEffectDialog(int cols, int rows, String title, ImageIcon icon) { this.dialog = new WebDialog(Spade.main.gui.frame, title); if(icon != null) dialog.setIconImage(icon.getImage()); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.setAlwaysOnTop(true); dialog.setAutoRequestFocus(true); dialog.setShowResizeCorner(false); panels = new JPanel[rows * cols]; JPanel pane = (JPanel) dialog.getContentPane(); WebPanel panel = new WebPanel(); panel.setLayout(new GridLayout(rows, cols)); for(int i = 0; i < cols * rows; i++) { panel.add(panels[i] = new WebPanel()); } bottom = new WebPanel(); pane.add(panel, BorderLayout.CENTER); pane.add(bottom, BorderLayout.SOUTH); }
Example 8
Source File: WebRootPane.java From weblaf with GNU General Public License v3.0 | 5 votes |
@Override protected Container createContentPane () { final WebPanel c = new WebPanel ( StyleId.rootpaneContent.at ( this ) ); c.setName ( getName () + ".contentPane" ); c.setLayout ( new BorderLayout () ); return c; }
Example 9
Source File: TabPanelMaintenance.java From mars-sim with GNU General Public License v3.0 | 4 votes |
public void initializeUI() { uiDone = true; // Create topPanel. WebPanel topPanel = new WebPanel(new GridLayout(2, 1)); centerContentPanel.add(topPanel); // Create maintenance panel. WebPanel maintenancePanel = new WebPanel(new BorderLayout()); topPanel.add(maintenancePanel); // Create maintenance label. WebLabel titleLabel = new WebLabel("Building Maintenance", WebLabel.CENTER); titleLabel.setFont(new Font("Serif", Font.BOLD, 16)); // titleLabel.setForeground(new Color(102, 51, 0)); // dark brown maintenancePanel.add(titleLabel, BorderLayout.NORTH); // Create scroll pane for maintenance list panel. maintenanceScrollPane = new WebScrollPane(); // increase vertical mousewheel scrolling speed for this one maintenanceScrollPane.getVerticalScrollBar().setUnitIncrement(16); maintenanceScrollPane.setPreferredSize(new Dimension(200, 75)); maintenancePanel.add(maintenanceScrollPane, BorderLayout.CENTER); // Prepare maintenance list panel. maintenanceListPanel = new WebPanel(new GridLayout(0, 1, 0, 0)); // maintenanceListPanel.setBorder(new MarsPanelBorder()); maintenanceScrollPane.setViewportView(maintenanceListPanel); populateMaintenanceList(); // Create malfunctions panel. WebPanel malfunctionsPanel = new WebPanel(new BorderLayout()); topPanel.add(malfunctionsPanel); // Create malfunctions label. WebLabel malfunctionsLabel = new WebLabel("Building Malfunctions", WebLabel.CENTER); malfunctionsLabel.setFont(new Font("Serif", Font.BOLD, 16)); // malfunctionsLabel.setForeground(new Color(102, 51, 0)); // dark brown malfunctionsPanel.add(malfunctionsLabel, BorderLayout.NORTH); // Create scroll panel for malfunctions list panel. malfunctionsScrollPane = new WebScrollPane(); // increase vertical mousewheel scrolling speed for this one malfunctionsScrollPane.getVerticalScrollBar().setUnitIncrement(16); malfunctionsScrollPane.setPreferredSize(new Dimension(200, 75)); malfunctionsPanel.add(malfunctionsScrollPane, BorderLayout.CENTER); // Prepare malfunctions outer list panel. WebPanel malfunctionsOuterListPanel = new WebPanel(new BorderLayout(0, 0)); // malfunctionsOuterListPanel.setBorder(new MarsPanelBorder()); malfunctionsScrollPane.setViewportView(malfunctionsOuterListPanel); // Prepare malfunctions list panel. malfunctionsListPanel = new WebPanel(); malfunctionsListPanel.setLayout(new BoxLayout(malfunctionsListPanel, BoxLayout.Y_AXIS)); malfunctionsOuterListPanel.add(malfunctionsListPanel, BorderLayout.NORTH); populateMalfunctionsList(); }
Example 10
Source File: BuildingPanelMalfunctionable.java From mars-sim with GNU General Public License v3.0 | 4 votes |
/** * Constructor. * * @param malfunctionable the malfunctionable building the panel is for. * @param desktop The main desktop. */ public BuildingPanelMalfunctionable(Malfunctionable malfunctionable, MainDesktopPane desktop) { // Use BuildingFunctionPanel constructor super((Building) malfunctionable, desktop); // Initialize data members. this.malfunctionable = malfunctionable; // Set panel layout setLayout(new BorderLayout()); // Create malfunctions label WebLabel malfunctionsLabel = new WebLabel(Msg.getString("BuildingPanelMalfunctionable.title"), WebLabel.CENTER); malfunctionsLabel.setFont(new Font("Serif", Font.BOLD, 16)); // malfunctionsLabel.setForeground(new Color(102, 51, 0)); // dark brown add(malfunctionsLabel, BorderLayout.NORTH); // Create scroll panel for malfunction list WebScrollPane scrollPanel = new WebScrollPane(); scrollPanel.setPreferredSize(new Dimension(170, 90)); add(scrollPanel, BorderLayout.CENTER); scrollPanel.setOpaque(false); scrollPanel.setBackground(new Color(0, 0, 0, 128)); scrollPanel.getViewport().setOpaque(false); scrollPanel.getViewport().setBackground(new Color(0, 0, 0, 128));// 0, 0, 0, 0)); // scrollPanel.setBorder( BorderFactory.createLineBorder(Color.LIGHT_GRAY) ); // Create malfunction list main panel. WebPanel malfunctionListMainPanel = new WebPanel(new BorderLayout(0, 0)); scrollPanel.setViewportView(malfunctionListMainPanel); // Create malfunction list panel malfunctionListPanel = new WebPanel(); malfunctionListPanel.setLayout(new BoxLayout(malfunctionListPanel, BoxLayout.Y_AXIS)); malfunctionListMainPanel.add(malfunctionListPanel, BorderLayout.NORTH); // Create malfunction panels malfunctionCache = new ArrayList<Malfunction>(malfunctionable.getMalfunctionManager().getMalfunctions()); malfunctionPanels = new ArrayList<MalfunctionPanel>(); Iterator<Malfunction> i = malfunctionCache.iterator(); while (i.hasNext()) { MalfunctionPanel panel = new MalfunctionPanel(i.next()); malfunctionListPanel.add(panel); malfunctionPanels.add(panel); } }
Example 11
Source File: TabPanelBuildings.java From mars-sim with GNU General Public License v3.0 | 4 votes |
public void initializeUI() { uiDone = true; List<Building> buildings = settlement.getBuildingManager().getSortedBuildings(); // Set building to the first element on the list // Add if-clause for opening the building panel via the right click popup menu if (building == null) { building = buildings.get(0); setCurrentBuilding(building); } // Create building select panel. // Add buildingInfoPanel & buildingTitleLabel WebPanel buildingInfoPanel = new WebPanel(new GridLayout(2, 1, 0, 0)); // buildingInfoPanel.setBorder(new MarsPanelBorder()); topContentPanel.add(buildingInfoPanel); panelList.add(buildingInfoPanel); WebLabel titleLabel = new WebLabel("Buildings", WebLabel.CENTER); titleLabel.setFont(new Font("Serif", Font.BOLD, 16)); // titleLabel.setForeground(new Color(102, 51, 0)); // dark brown buildingInfoPanel.add(titleLabel); titleLabel.setOpaque(false); titleLabel.setBackground(new Color(0, 0, 0, 128)); WebPanel buildingSelectPanel = new WebPanel(new FlowLayout(FlowLayout.CENTER)); buildingInfoPanel.add(buildingSelectPanel); panelList.add(buildingSelectPanel); // Create building combo box model. comboBoxModel = new DefaultComboBoxModel<Building>(); buildingsCache = new ArrayList<Building>(buildings); for (Building b : buildingsCache) { comboBoxModel.addElement(b); } // Create building list. comboBox = new JComboBoxMW<Building>(comboBoxModel); // comboBox.setRenderer(new PromptComboBoxRenderer("Select a Building")); // comboBox.setOpaque(false); // comboBox.setBackground(new Color(0,0,0,128)); // comboBox.setBackground(new Color(255,229,204)); // comboBox.setForeground(Color.orange); comboBox.addActionListener(this); comboBox.setMaximumRowCount(10); comboBox.setBorder(null); buildingSelectPanel.add(comboBox); // Create building display panel. buildingDisplayPanel = new WebPanel(); buildingLayout = new CardLayout(); buildingDisplayPanel.setLayout(buildingLayout); // buildingDisplayPanel.setBorder(new MarsPanelBorder()); centerContentPanel.add(buildingDisplayPanel); panelList.add(buildingDisplayPanel); // Create building panels buildingPanels = new ArrayList<BuildingPanel>(); count = 0; Iterator<Building> iter = buildings.iterator(); while (iter.hasNext()) { BuildingPanel panel = new BuildingPanel(String.valueOf(count), iter.next(), desktop); buildingPanels.add(panel); buildingDisplayPanel.add(panel, panel.getPanelName()); count++; } setPanelTranslucent(); }
Example 12
Source File: EventFilter.java From mars-sim with GNU General Public License v3.0 | 4 votes |
/** * Constructor. * @param model the event table model * @param desktop the main desktop */ public EventFilter(EventTableModel model, MainDesktopPane desktop) { // Use JInternalFrame constructor. super(Msg.getString("EventFilter.title"), false, true); //$NON-NLS-1$ // Initialize data members. this.model = model; // Prepare content pane WebPanel mainPane = new WebPanel(); mainPane.setLayout(new BorderLayout()); mainPane.setBorder(MainDesktopPane.newEmptyBorder()); setContentPane(mainPane); // Create category pane WebPanel categoryPane = new WebPanel(new GridLayout(5, 1)); categoryPane.setBorder(new MarsPanelBorder()); mainPane.add(categoryPane, BorderLayout.CENTER); // Create transport events checkbox. hazardCheck = new WebCheckBox(HistoricalEventCategory.HAZARD.getName()); hazardCheck.setSelected(model.getDisplayHazard()); hazardCheck.addActionListener(this); categoryPane.add(hazardCheck); // Create mechanical events checkbox. malfunctionCheck = new WebCheckBox(HistoricalEventCategory.MALFUNCTION.getName()); malfunctionCheck.setSelected(model.getDisplayMalfunction()); malfunctionCheck.addActionListener(this); categoryPane.add(malfunctionCheck); // Create medical events checkbox. medicalCheck = new WebCheckBox(HistoricalEventCategory.MEDICAL.getName()); medicalCheck.setSelected(model.getDisplayMedical()); medicalCheck.addActionListener(this); categoryPane.add(medicalCheck); // Create mission events checkbox. missionCheck = new WebCheckBox(HistoricalEventCategory.MISSION.getName()); missionCheck.setSelected(model.getDisplayMission()); missionCheck.addActionListener(this); categoryPane.add(missionCheck); // Create task events checkbox. taskCheck = new WebCheckBox(HistoricalEventCategory.TASK.getName()); taskCheck.setSelected(model.getDisplayTask()); taskCheck.addActionListener(this); categoryPane.add(taskCheck); // Create transport events checkbox. transportCheck = new WebCheckBox(HistoricalEventCategory.TRANSPORT.getName()); transportCheck.setSelected(model.getDisplayTransport()); transportCheck.addActionListener(this); categoryPane.add(transportCheck); pack(); desktop.add(this); }
Example 13
Source File: Popup.java From Spade with GNU General Public License v3.0 | 4 votes |
public static void showException(String title, Exception e, String msg2) { WebDialog dialog = new WebDialog(Spade.main.gui.frame, title); dialog.setModal(true); WebTextArea text = new WebTextArea(); text.setEditable(false); text.setWrapStyleWord(true); text.setLineWrap(true); text.setFontName(Font.MONOSPACED); StringWriter msg = new StringWriter(); e.printStackTrace(new PrintWriter(msg)); text.append(msg.toString()); JPanel panel = (JPanel) dialog.getContentPane(); panel.setLayout(new BorderLayout()); panel.setPreferredSize(new Dimension(800, 400)); WebScrollPane scroll = new WebScrollPane(text); panel.add(new WebLabel("An Exception Occured: ").setMargin(5), BorderLayout.NORTH); panel.add(scroll, BorderLayout.CENTER); WebPanel bottom = new WebPanel(); bottom.setLayout(new BorderLayout()); WebTextArea report = new WebTextArea("Please copy the above message and report it to " + Spade.REPO_URL + " along with details of what you were doing when it happened."); report.setLineWrap(true); report.setWrapStyleWord(true); report.setEditable(false); report.setMargin(5); WebTextArea endMsg = new WebTextArea(msg2); endMsg.setLineWrap(true); endMsg.setWrapStyleWord(true); endMsg.setEditable(false); endMsg.setMargin(5); bottom.add(report, BorderLayout.NORTH); bottom.add(endMsg, BorderLayout.CENTER); panel.add(bottom, BorderLayout.SOUTH); dialog.pack(); dialog.setResizable(true); dialog.setVisible(true); dialog.setLocationRelativeTo(Spade.main.gui.frame); }