Java Code Examples for javax.swing.JSeparator#setOrientation()

The following examples show how to use javax.swing.JSeparator#setOrientation() . 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: ToolbarContainer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public ToolbarAqua() {
    super( new BorderLayout() );
    JSeparator sep = new JToolBar.Separator();
    sep.setOrientation(JSeparator.VERTICAL);
    sep.setForeground(UIManager.getColor("NbSplitPane.background")); //NOI18N
    add( sep, BorderLayout.CENTER );
    dim = new Dimension (GRIP_WIDTH, GRIP_WIDTH);
    max = new Dimension (GRIP_WIDTH, Integer.MAX_VALUE);
    setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
}
 
Example 2
Source File: ReservedCheckinWindow.java    From Hotel-Properties-Management-System with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create the dialog.
 */
public ReservedCheckinWindow(Room roomNumber) {

	this.ownInjectedRoom = roomNumber;
	
	loggingEngine = LoggingEngine.getInstance();
	loggingEngine.setMessage("User is : " + sessionBean.getNickName());
	
	setMinimumSize(new Dimension(750, 495));
	setPreferredSize(new Dimension(750, 495));
	setLocationRelativeTo(null);

	this.setIconImage(Toolkit.getDefaultToolkit().
			getImage(getClass().getResource(LOGOPATH)));

	getContentPane().setForeground(new Color(255, 99, 71));
	getContentPane().setFocusCycleRoot(true);
	getContentPane().setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
	getContentPane().setFont(new Font("Verdana", Font.BOLD, 12));
	setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
	setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	setModal(true);
	setResizable(false);

	this.setTitle("Coder HPMSA - [Checkin]");
	contentPanel.setAutoscrolls(true);
	contentPanel.setPreferredSize(new Dimension(10, 415));

	contentPanel.setBackground(Color.decode("#066d95"));
	contentPanel.setLayout(new BorderLayout(0, 0));
	getContentPane().add(contentPanel, BorderLayout.SOUTH);

	upperPanel = new JPanel();
	upperPanel.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
	upperPanel.setBackground(new Color(135, 206, 235));
	upperPanel.setPreferredSize(new Dimension(10, 35));
	contentPanel.add(upperPanel, BorderLayout.NORTH);

	JLabel lblChangeRoomPerson = new JLabel("Change person count : ");
	lblChangeRoomPerson.setFont(new Font("Arial", Font.PLAIN, 15));
	upperPanel.add(lblChangeRoomPerson);

	spinner = new JSpinner();
	spinner.setModel(new SpinnerNumberModel(1, 1, 3, 1));
	spinner.setPreferredSize(new Dimension(40, 20));
	spinner.setMinimumSize(new Dimension(35, 20));
	spinner.addChangeListener(customerCounterListener());
	upperPanel.add(spinner);

	JPanel buttonPanel = new JPanel();
	buttonPanel.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
	buttonPanel.setPreferredSize(new Dimension(10, 50));
	buttonPanel.setLayout(null);
	getContentPane().add(buttonPanel, BorderLayout.NORTH);

	JButton roomCheckinBtn = new JButton("Room checkin");
	roomCheckinBtn.addActionListener(this);
	roomCheckinBtn.setIcon(new ImageIcon(ReservedCheckinWindow.class
					.getResource("/com/coder/hms/icons/extra_checkin.png")));
	roomCheckinBtn.setBounds(7, 4, 130, 42);
	buttonPanel.add(roomCheckinBtn);

	final JSeparator separator = new JSeparator();
	separator.setBackground(Color.DARK_GRAY);
	separator.setBounds(149, 6, 10, 36);
	separator.setOrientation(SwingConstants.VERTICAL);
	separator.setFocusable(true);
	separator.setForeground(Color.DARK_GRAY);
	separator.setAutoscrolls(true);
	separator.setPreferredSize(new Dimension(10, 20));
	buttonPanel.add(separator);

	JLabel lblRoom = new JLabel("ROOM : ");
	lblRoom.setFont(new Font("Verdana", Font.BOLD, 15));
	lblRoom.setBounds(330, 8, 68, 33);
	buttonPanel.add(lblRoom);

	JLabel roomNumberLbl = new JLabel(ownInjectedRoom.getNumber());
	roomNumberLbl.setForeground(new Color(220, 20, 60));
	roomNumberLbl.setFont(new Font("Verdana", Font.BOLD, 17));
	roomNumberLbl.setBounds(406, 8, 103, 33);
	buttonPanel.add(roomNumberLbl);
	
	contentPanel.add(customerFormOne.setCustomerDetailPanel(), BorderLayout.WEST);
	prepareCustomerForms(ownInjectedRoom.getNumber());

}
 
Example 3
Source File: AKDockLayout.java    From WorldPainter with GNU General Public License v3.0 2 votes vote down vote up
private void flipSeparators(Component c, int orientn) {

        if (c != null && c instanceof JToolBar
                && UIManager.getLookAndFeel().getName().toLowerCase().indexOf("windows")
                != -1) {

            JToolBar jtb = (JToolBar) c;

            Component comps[] = jtb.getComponents();

            if (comps != null && comps.length > 0) {

                for (int i = 0; i < comps.length; i++) {

                    try {

                        Component component = comps[i];

                        if (component != null) {

                            if (component instanceof JSeparator) {

                                jtb.remove(component);

                                JSeparator separ = new JSeparator();

                                if (orientn == SwingConstants.VERTICAL) {

                                    separ.setOrientation(SwingConstants.VERTICAL);

                                    separ.setMinimumSize(new Dimension(2, 6));

                                    separ.setPreferredSize(new Dimension(2, 6));

                                    separ.setMaximumSize(new Dimension(2, 100));

                                } else {

                                    separ.setOrientation(SwingConstants.HORIZONTAL);

                                    separ.setMinimumSize(new Dimension(6, 2));

                                    separ.setPreferredSize(new Dimension(6, 2));

                                    separ.setMaximumSize(new Dimension(100, 2));

                                }

                                jtb.add(separ, i);

                            }

                        }

                    } catch (Exception e) {

                        e.printStackTrace();

                    }

                }

            }

        }

    }