Java Code Examples for javax.swing.JPanel.setBorder()

The following are Jave code examples for showing how to use setBorder() of the javax.swing.JPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: xdman   File: HelpDialog.java   View Source Code Vote up 6 votes
public HelpDialog() {
	setTitle(StringResource.getString("DEFAULT_TITLE"));
	setSize(640, 480);
	htmlPane = new JEditorPane();
	JPanel panel = new JPanel(new BorderLayout(5, 5));
	panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
	panel.add(new JScrollPane(htmlPane));
	add(panel);
	model = new HelpListModel();
	helpList = new JList(values);
	JPanel p = new JPanel(new BorderLayout());
	p.add(createToolBar(), BorderLayout.NORTH);
	p.add(new JScrollPane(helpList));
	panel.add(p, BorderLayout.WEST);
	setIconImage(XDMIconMap.getIcon("APP_ICON").getImage());
	helpList.addListSelectionListener(this);
	htmlPane.setEditable(false);
	map.put(keys[0], getClass().getResource(
			"/help/browser_integration.html"));
	map.put(keys[1], getClass().getResource("/help/video_download.html"));
	map.put(keys[2], getClass().getResource("/help/refresh_link.html"));
}
 
Example 2
Project: hml   File: TreePanel_Container.java   View Source Code Vote up 6 votes
public JPanel createButtonPane() {
	ButtonGroup group = new ButtonGroup();

	// Text Button Panel
	JPanel ButtonPanel = new JPanel();
	ButtonPanel.setLayout(new BoxLayout(ButtonPanel, BoxLayout.X_AXIS));
	ButtonPanel.setBorder(border5);
 
	// Add Button

	btn1 = createRun1Button(); ButtonPanel.add(btn1); group.add(btn1); ButtonPanel.add(Box.createRigidArea(VGAP5));
	btn2 = createRun2Button(); ButtonPanel.add(btn2); group.add(btn2); ButtonPanel.add(Box.createRigidArea(VGAP5));
	btn3 = createRun3Button(); ButtonPanel.add(btn3); group.add(btn3); ButtonPanel.add(Box.createRigidArea(VGAP5));
	btn4 = createRun4Button(); ButtonPanel.add(btn4); group.add(btn4); ButtonPanel.add(Box.createRigidArea(VGAP5));
	
	return ButtonPanel;
}
 
Example 3
Project: JITRAX   File: TablePanel.java   View Source Code Vote up 6 votes
public TablePanel(Table aTable) {
	table = aTable;
	innerPanel = new JPanel();
	
	add(innerPanel);
	
	// Adding the panel's border padding
	setLayout(new FlowLayout(FlowLayout.LEFT));
	innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS));
	innerPanel.setBorder(BorderFactory.createEmptyBorder(NEW_TABLE_PANEL_TOP_PADDING, 
											NEW_TABLE_PANEL_LEFT_PADDING, 
											NEW_TABLE_PANEL_BOTTOM_PADDING, 
											NEW_TABLE_PANEL_RIGHT_PADDING));
	
	// Fill the panel with the attributes info
	addAttributes();
	
	// Common settings
	setBackground(BACKGROUND_COLOR);
	innerPanel.setBackground(BACKGROUND_COLOR);
}
 
Example 4
Project: propan-jogl-examples   File: Example.java   View Source Code Vote up 5 votes
public static JComponent createComponent() {
	JPanel panel = new JPanel(new BorderLayout());
	panel.setDoubleBuffered(false);

	panel.add(new JButton("Press me!"), BorderLayout.NORTH);

	JProgressBar bar = new JProgressBar() {
		protected void paintComponent(java.awt.Graphics g) {
			if (g instanceof GLGraphics2D
					) {
				super.paintComponent(g);
			} else {
				System.out.println(g.getClass());
			}
		}
	};
	bar.setIndeterminate(true);
	panel.add(bar, BorderLayout.SOUTH);
	panel.add(new JSlider(SwingConstants.VERTICAL, 0, 10, 3), BorderLayout.EAST);

	ButtonGroup grp = new ButtonGroup();
	JRadioButton radio1 = new JRadioButton("FM");
	JRadioButton radio2 = new JRadioButton("AM");
	grp.add(radio1);
	grp.add(radio2);

	JPanel panel2 = new JPanel(new GridLayout(0, 1));
	panel2.add(radio1);
	panel2.add(radio2);

	JComboBox b = new JComboBox(new String[] {"3", "4"});

	panel.add(b, BorderLayout.WEST);

	panel.setBorder(BorderFactory.createTitledBorder("Border"));

	return panel;
}
 
Example 5
Project: geomapapp   File: CustomDB.java   View Source Code Vote up 5 votes
protected void createConfigPanel(JPanel p) {
	configPanel = new JPanel(new GridLayout(0,1));
	configPanel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
	configPanel.add(p);

	//JOC : Set a min size width to keep combo boxs under control
	configPanel.setMinimumSize(new Dimension(110, configPanel.getMinimumSize().height));
	configPanel.setPreferredSize(new Dimension(160, configPanel.getPreferredSize().height));
}
 
Example 6
Project: openjdk-jdk10   File: Test6981576.java   View Source Code Vote up 5 votes
public void run() {
    if (this.infos == null) {
        this.infos = UIManager.getInstalledLookAndFeels();
        Thread.currentThread().setUncaughtExceptionHandler(this);
        JPanel panel = new JPanel();
        panel.setBorder(this);
        this.frame = new JFrame(getClass().getSimpleName());
        this.frame.add(panel);
        this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.frame.setVisible(true);
    }
    if (this.index == this.infos.length) {
        this.frame.dispose();
    }
    else {
        LookAndFeelInfo info = this.infos[this.index % this.infos.length];
        try {
            UIManager.setLookAndFeel(info.getClassName());
        }
        catch (Exception exception) {
            System.err.println("could not change look and feel");
        }
        SwingUtilities.updateComponentTreeUI(this.frame);
        this.frame.pack();
        this.frame.setLocationRelativeTo(null);
        this.index++;
        SwingUtilities.invokeLater(this);
    }
}
 
Example 7
Project: routerapp   File: GASettings.java   View Source Code Vote up 5 votes
public void actionPerformed (ActionEvent evt) {
	centerPanel = new JPanel(new FlowLayout());

	maxGenerationsLabel = new JLabel("Max Generations");		
	maxGenerationsField = new JTextField((new Integer(TSProblemModel.DEFAULT_GA_MAX_GENERATIONS)).toString(), 5);
	
	popSizeLabel = new JLabel("Population Size");		
	popSizeField = new JTextField((new Integer(TSProblemModel.DEFAULT_GA_POP_SIZE)).toString(), 5);

	mutationRateLabel = new JLabel("Mutation Rate");		
	mutationRateField = new JTextField((new Double(TSProblemModel.DEFAULT_MUTATION_RATE)).toString(), 5);
	
	orderedCrossoverBox = new JCheckBox("Ordered Crossover", TSProblemModel.DEFAULT_ORDERED_CROSSOVER);
	cyclicCrossoverBox = new JCheckBox("Cyclic Crossover", TSProblemModel.DEFAULT_CYCLIC_CROSSOVER);
	pmxCrossoverBox = new JCheckBox("PMX Crossover", TSProblemModel.DEFAULT_PMX_CROSSOVER);
	simulatedAnnealingBox = new JCheckBox("Simulated Annealing", TSProblemModel.DEFAULT_ANNEAL);
	inverOverBox = new JCheckBox("Inver Over", TSProblemModel.DEFAULT_INVER_OVER);

	centerPanel.add(maxGenerationsLabel);
	centerPanel.add(maxGenerationsField);		
	centerPanel.add(popSizeLabel);
	centerPanel.add(popSizeField);
	centerPanel.add(mutationRateLabel);
	centerPanel.add(mutationRateField);			
	centerPanel.add(orderedCrossoverBox);
	centerPanel.add(cyclicCrossoverBox);	
	centerPanel.add(pmxCrossoverBox);
	centerPanel.add(inverOverBox);
	centerPanel.add(simulatedAnnealingBox);
	
	centerPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
	centerPanel.setForeground(Color.getColor("202,198,202"));
	
	getContentPane().add(centerPanel,BorderLayout.CENTER);					
}
 
Example 8
Project: rapidminer   File: CurveViewer.java   View Source Code Vote up 5 votes
public CurveViewer(CurveCollection curves) {
   setLayout(new BorderLayout());

    String message = curves.toString();

    criterionName = curves.getName();

    // info string
    JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    infoPanel.setOpaque(true);
    infoPanel.setBackground(Colors.WHITE);
    JTextPane infoText = new JTextPane();
    infoText.setEditable(false);
    infoText.setBackground(infoPanel.getBackground());
    infoText.setFont(infoText.getFont().deriveFont(Font.BOLD));
    infoText.setText(message);
    infoPanel.add(infoText);
    add(infoPanel, BorderLayout.NORTH);

    // plot panel
    plotter = new CurveChartPlotter();
    plotter.setCurve(curves);

    JPanel innerPanel = new JPanel(new BorderLayout());
    innerPanel.add(plotter, BorderLayout.CENTER);
    innerPanel.setBorder(BorderFactory.createMatteBorder(5, 0, 10, 10, Colors.WHITE));
    add(innerPanel, BorderLayout.CENTER);
}
 
Example 9
Project: incubator-netbeans   File: UpdatePanel.java   View Source Code Vote up 5 votes
private void initComponents() {
    org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "UpdatePanel.infoLabel.text")); // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "UpdatePanel.infoLabel2.text")); // NOI18N
    forcedUpdateChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(forcedUpdateChxBox, org.openide.util.NbBundle.getMessage(UpdatePanel.class, "UpdatePanel.forcedUpdateChxBox.text")); // NOI18N
    JPanel optionsPanel = new JPanel(new BorderLayout());
    optionsPanel.add(forcedUpdateChxBox, BorderLayout.NORTH);
    optionsPanel.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
    setOptionsPanel(optionsPanel, null);
}
 
Example 10
Project: java-irc   File: Channel.java   View Source Code Vote up 5 votes
/**
 * Create the frame to choose the channel
 */
public Channel() {
	this.setTitle("Chat IRC");
	this.setResizable(false);
	this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	this.setBounds(100, 100, 460, 261);
	this.setLocationRelativeTo(null);
	setIconImage(Toolkit.getDefaultToolkit().getImage(Channel.class.getResource("/image/swag.png")));
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(null);
	
	JButton btnOk = new JButton("OK");
	Icon imgOk = new ImageIcon(Toolkit.getDefaultToolkit().getImage(Channel.class.getResource("/image/ok.png")));
	btnOk.setIcon(imgOk);
	btnOk.setFont(new Font("Tahoma", Font.BOLD, 14));
	btnOk.addActionListener(new ChannelListener());
	btnOk.setBounds(164, 152, 104, 30);
	contentPane.add(btnOk);
	
	JLabel lblChannel = new JLabel("Channel");
	lblChannel.setHorizontalAlignment(SwingConstants.LEFT);
	lblChannel.setFont(new Font("Tahoma", Font.BOLD, 14));
	lblChannel.setBounds(187, 30, 72, 30);
	contentPane.add(lblChannel);
	
	textFieldChannel = new JTextField();
	textFieldChannel.setFont(new Font("Tahoma", Font.PLAIN, 14));
	textFieldChannel.setBounds(115, 85, 203, 30);
	contentPane.add(textFieldChannel);
	textFieldChannel.setColumns(10);
	
	this.addWindowListener( new WindowAdapter() {
		public void windowClosing(WindowEvent e) {
			closeFrame();
		}
	});
}
 
Example 11
Project: jdk8u-jdk   File: XSheet.java   View Source Code Vote up 5 votes
private void displayMBeanNotificationsNode(DefaultMutableTreeNode node) {
    final XNodeInfo uo = (XNodeInfo) node.getUserObject();
    if (!uo.getType().equals(Type.NOTIFICATIONS)) {
        return;
    }
    mbean = (XMBean) uo.getData();
    mbeanNotifications.loadNotifications(mbean);
    updateNotifications();
    invalidate();
    mainPanel.removeAll();
    JPanel borderPanel = new JPanel(new BorderLayout());
    borderPanel.setBorder(BorderFactory.createTitledBorder(
            Messages.NOTIFICATION_BUFFER));
    borderPanel.add(new JScrollPane(mbeanNotifications));
    mainPanel.add(borderPanel, BorderLayout.CENTER);
    // add the subscribe/unsubscribe/clear buttons to the south panel
    southPanel.removeAll();
    southPanel.add(subscribeButton, BorderLayout.WEST);
    southPanel.add(unsubscribeButton, BorderLayout.CENTER);
    southPanel.add(clearButton, BorderLayout.EAST);
    southPanel.setVisible(true);
    subscribeButton.setEnabled(true);
    unsubscribeButton.setEnabled(true);
    clearButton.setEnabled(true);
    validate();
    repaint();
}
 
Example 12
Project: incubator-netbeans   File: SwitchToBranchAction.java   View Source Code Vote up 5 votes
@Override
protected void performContextAction(Node[] nodes) {
    final VCSContext ctx = HgUtils.getCurrentContext(nodes);
    final File roots[] = HgUtils.getActionRoots(ctx);
    if (roots == null || roots.length == 0) return;
    final File root = Mercurial.getInstance().getRepositoryRoot(roots[0]);

    final BranchSelector switchBranch = new BranchSelector(root);
    JCheckBox forcedUpdateChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(forcedUpdateChxBox, org.openide.util.NbBundle.getMessage(SwitchToBranchAction.class, "SwitchTo.forcedUpdateChxBox.text")); // NOI18N
    JPanel optionsPanel = new JPanel(new BorderLayout());
    optionsPanel.add(forcedUpdateChxBox, BorderLayout.NORTH);
    optionsPanel.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
    switchBranch.setOptionsPanel(optionsPanel, null);
    
    JButton okButton = new JButton();
    org.openide.awt.Mnemonics.setLocalizedText(okButton, org.openide.util.NbBundle.getMessage(BranchSelector.class, "CTL_SwitchToForm_Action_SwitchTo")); // NOI18N
    okButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSD_SwitchToForm_Action_SwitchTo")); // NOI18N
    okButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSN_SwitchToForm_Action_SwitchTo")); // NOI18N
    okButton.setEnabled(false);
    
    if (!switchBranch.showDialog(okButton, org.openide.util.NbBundle.getMessage(BranchSelector.class, "CTL_SwitchToDialog", root.getName()), //NOI18N
            org.openide.util.NbBundle.getMessage(SwitchToBranchAction.class, "SwitchToPanel.infoLabel.text"))) { //NOI18N
        return;
    }
    final String revStr = switchBranch.getBranchName();
    if (revStr == null) {
        return;
    }
    final boolean doForcedUpdate = forcedUpdateChxBox.isSelected();
    doSwitch(root, revStr, doForcedUpdate, ctx); //NOI18N
}
 
Example 13
Project: jmt   File: ServiceSectionPanel.java   View Source Code Vote up 5 votes
private void initComponents() {
	//building mainPanel
	this.setLayout(new BorderLayout(5, 5));
	this.setBorder(new EmptyBorder(5, 5, 5, 5));
	//layout of main panel
	JPanel serversNumPanel = new JPanel();
	serversNumPanel.setBorder(new TitledBorder(new EtchedBorder(), "Number of Servers"));
	serversNumPanel.add(new JLabel("Number:"));
	serversNumPanel.add(serversNumSpinner);
	this.add(serversNumPanel, BorderLayout.NORTH);
	WarningScrollTable ServiceSectionTable = new WarningScrollTable(serviceTable, WARNING_CLASS);
	ServiceSectionTable.setBorder(new TitledBorder(new EtchedBorder(), "Service Time Distributions"));
	this.add(ServiceSectionTable, BorderLayout.CENTER);
}
 
Example 14
Project: Equella   File: Wizard.java   View Source Code Vote up 5 votes
/**
 * Create the installation window which the pages appear in.
 */
private void createWindow()
{
	JImage sideImage = new JImage(getClass().getResource(imagePath));
	sideImage.setVerticalAlignment(SwingConstants.TOP);
	sideImage.setAlignmentY(Component.TOP_ALIGNMENT);

	pageArea = new JPanel();
	pageArea.setLayout(new GridLayout(1, 1));

	JSeparator bar = new JSeparator();

	navArea = new JPanel();
	navArea.setLayout(new GridLayout(1, 1));

	JPanel bottom = new JPanel(new BorderLayout(5, 5));
	bottom.add(bar, BorderLayout.NORTH);
	bottom.add(navArea, BorderLayout.CENTER);

	JPanel all = new JPanel(new BorderLayout(5, 5));
	all.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
	all.add(sideImage, BorderLayout.WEST);
	all.add(pageArea, BorderLayout.CENTER);
	all.add(bottom, BorderLayout.SOUTH);

	frame = new JFrame();
	frame.getContentPane().add(all);
	frame.setTitle(productName);
	frame.setResizable(false);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
 
Example 15
Project: Logisim   File: AttrTable.java   View Source Code Vote up 5 votes
private void configure(JInputComponent input) {
	this.input = input;
	this.value = input.getValue();

	// Thanks to Christophe Jacquet, who contributed a fix to this
	// so that when the dialog is resized, the component within it
	// is resized as well. (Tracker #2024479)
	JPanel p = new JPanel(new BorderLayout());
	p.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
	p.add((JComponent) input, BorderLayout.CENTER);
	getContentPane().add(p, BorderLayout.CENTER);

	pack();
}
 
Example 16
Project: TwitchBouyomi   File: Main.java   View Source Code Vote up 4 votes
public Main() {
	setTitle("Twitch Comment Talker");
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	ImageIcon icon = new ImageIcon("./icon.png");
    setIconImage(icon.getImage());
	setBounds(100, 100, 300, 248);
	setResizable(false);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(null);

	JLabel lblAuthPassword = new JLabel("OAuth Pass");
	lblAuthPassword.setBounds(12, 10, 86, 13);
	contentPane.add(lblAuthPassword);

	textAuthPassword = new JPasswordField();
	textAuthPassword.setBounds(110, 7, 172, 19);
	contentPane.add(textAuthPassword);
	textAuthPassword.setEchoChar('*');
	textAuthPassword.setColumns(10);
	textAuthPassword.setEditable(false);

	JLabel lblUserName = new JLabel("Channel Name");
	lblUserName.setBounds(12, 33, 86, 13);
	contentPane.add(lblUserName);

	textUserName = new JTextField();
	textUserName.setBounds(110, 30, 172, 19);
	contentPane.add(textUserName);
	textUserName.setColumns(10);
	textUserName.setToolTipText("https://www.twitch.tv/~~~の~~~部分をそのまま入力して下さい。");

	btnConnect.setBounds(8, 148, 276, 38);
	contentPane.add(btnConnect);
	btnConnect.addActionListener(this);
	btnConnect.setActionCommand("btnConnect");
	btnConnect.setToolTipText("Twitchコメントに接続します。");

	JLabel lblStatus = new JLabel("Status:");
	lblStatus.setBounds(12, 196, 43, 13);
	contentPane.add(lblStatus);

	lblStatus_1.setBounds(67, 196, 215, 13);
	contentPane.add(lblStatus_1);

	chkReadName.setBounds(8, 52, 264, 21);
	contentPane.add(chkReadName);
	chkReadName.addActionListener(this);
	chkReadName.setActionCommand("chkReadName");
	chkReadName.setToolTipText("コメント投稿者のユーザー名を読み上げます。");

	chkUseEnglish.setBounds(8, 75, 137, 21);
	contentPane.add(chkUseEnglish);
	chkUseEnglish.addActionListener(this);
	chkUseEnglish.setActionCommand("chkUseEnglish");
	chkUseEnglish.setToolTipText("英文が投稿された時、SAPI5で読み上げをします。");


	btnSAPI = new JButton(vapi.getVoice());
	btnSAPI.setBounds(153, 76, 129, 19);
	contentPane.add(btnSAPI);
	btnSAPI.addActionListener(this);
	btnSAPI.setActionCommand("btnSAPI");
	
	chkPopup.setBounds(8, 121, 137, 21);
	contentPane.add(chkPopup);
	chkPopup.addActionListener(this);
	chkPopup.setActionCommand("chkPopup");
	chkPopup.setToolTipText("コメント受信時に通知ポップアップを表示します。");
	
	chkReadEmote.setBounds(8, 98, 137, 21);
	contentPane.add(chkReadEmote);
	chkReadEmote.addActionListener(this);
	chkReadEmote.setActionCommand("chkReadEmote");
	chkReadEmote.setToolTipText("エモート語句を読み上げします。");

	loadConfigFile();
	
}
 
Example 17
Project: JHearthstone   File: SignUpPanel.java   View Source Code Vote up 4 votes
/**
 * Create the panel.
 */
public SignUpPanel() {
	setLayout(null);
	
	JLabel lblNewLabel = new JLabel("Hearthstone");
	lblNewLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 35));
	lblNewLabel.setBounds(150, 35, 211, 61);
	add(lblNewLabel);
	
	JPanel panel = new JPanel();
	panel.setBorder(new LineBorder(new Color(0, 0, 0)));
	panel.setBounds(434, 20, 245, 260);
	add(panel);
	panel.setLayout(null);
	
	JLabel lblUpdateNotes = new JLabel("Update Notes:");
	lblUpdateNotes.setBounds(6, 6, 89, 16);
	panel.add(lblUpdateNotes);
	
	JTextPane txtpn_UpdateNotes = new JTextPane();
	txtpn_UpdateNotes.setEditable(false);
	txtpn_UpdateNotes.setBackground(this.getBackground());
	txtpn_UpdateNotes.setText("* Added Support for Multiplayer\n\n\n* Support for login\n\n\n* Server can hold multiple games at once");
	txtpn_UpdateNotes.setBounds(16, 34, 211, 207);
	panel.add(txtpn_UpdateNotes);
	
	JLabel label = new JLabel("Username:");
	label.setBounds(58, 103, 70, 16);
	add(label);
	
	txt_Username = new JTextField();
	txt_Username.setColumns(20);
	txt_Username.setBounds(134, 97, 254, 28);
	add(txt_Username);
	
	JLabel label_1 = new JLabel("Password:");
	label_1.setBounds(65, 151, 63, 16);
	add(label_1);
	
	psf_Password = new JPasswordField();
	psf_Password.setColumns(20);
	psf_Password.setBounds(134, 145, 254, 28);
	add(psf_Password);
	
	pwf_Retype = new JPasswordField();
	pwf_Retype.setColumns(20);
	pwf_Retype.setBounds(134, 191, 254, 28);
	add(pwf_Retype);
	
	JLabel lblRetypePassword = new JLabel("Retype Password:");
	lblRetypePassword.setBounds(19, 197, 109, 16);
	add(lblRetypePassword);
	
	btn_Login = new JButton("Login");
	btn_Login.setBounds(134, 240, 117, 29);
	add(btn_Login);
	
	btn_SignUp = new JButton("Sign Up");
	btn_SignUp.setBounds(271, 240, 117, 29);
	add(btn_SignUp);

}
 
Example 18
Project: openjdk-jdk10   File: MetalworksPrefs.java   View Source Code Vote up 4 votes
public JPanel buildFilterPanel() {
    JPanel filters = new JPanel();
    filters.setLayout(new GridLayout(1, 0));

    JPanel spamPanel = new JPanel();

    spamPanel.setLayout(new ColumnLayout());
    spamPanel.setBorder(new TitledBorder("Spam"));
    ButtonGroup spamGroup = new ButtonGroup();
    JRadioButton file = new JRadioButton("File in Spam Folder");
    JRadioButton delete = new JRadioButton("Auto Delete");
    JRadioButton bomb = new JRadioButton("Reverse Mail-Bomb");
    spamGroup.add(file);
    spamGroup.add(delete);
    spamGroup.add(bomb);
    spamPanel.add(file);
    spamPanel.add(delete);
    spamPanel.add(bomb);
    file.setSelected(true);
    filters.add(spamPanel);

    JPanel autoRespond = new JPanel();
    autoRespond.setLayout(new ColumnLayout());
    autoRespond.setBorder(new TitledBorder("Auto Response"));

    ButtonGroup respondGroup = new ButtonGroup();
    JRadioButton none = new JRadioButton("None");
    JRadioButton vaca = new JRadioButton("Send Vacation Message");
    JRadioButton thx = new JRadioButton("Send Thank You Message");

    respondGroup.add(none);
    respondGroup.add(vaca);
    respondGroup.add(thx);

    autoRespond.add(none);
    autoRespond.add(vaca);
    autoRespond.add(thx);

    none.setSelected(true);
    filters.add(autoRespond);

    return filters;
}
 
Example 19
Project: javaportfolio   File: OpenPortfolioDialog.java   View Source Code Vote up 4 votes
public OpenPortfolioDialog(Component frameComp, Component locationComp,
		String title, Object[] portfolios) {
	super(JOptionPane.getFrameForComponent(frameComp), title, true);

	// Create and initialize the buttons.
	cancelButton = new JButton(BUTTON_CANCEL);
	cancelButton.addActionListener(this);
	cancelButton.setActionCommand(BUTTON_CANCEL);

	okButton = new JButton(BUTTON_OK);
	okButton.setActionCommand(BUTTON_OK);
	okButton.addActionListener(this);
	getRootPane().setDefaultButton(okButton);
	
	portfolioList = new JComboBox(portfolios);
	portfolioFieldLabel = new JLabel("Salkun nimi: ");
	portfolioFieldLabel.setLabelFor(portfolioList);
	
	JPanel textControlsPane = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.anchor = GridBagConstraints.EAST;
	c.insets = new Insets(10, 10, 10, 10); // this statement added.
	
	textControlsPane.add(portfolioFieldLabel,c);
	textControlsPane.add(portfolioList, c);
	
	// Lay out the buttons from left to right.
	JPanel buttonPane = new JPanel();
	buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
	buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
	buttonPane.add(Box.createHorizontalGlue());
	buttonPane.add(cancelButton);
	buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
	buttonPane.add(okButton);
	
	// Put everything together, using the content pane's BorderLayout.
	Container contentPane = getContentPane();
	contentPane.add(textControlsPane, BorderLayout.CENTER);
	contentPane.add(buttonPane, BorderLayout.PAGE_END);

	pack();
	setLocationRelativeTo(locationComp);
	setVisible(true);
}
 
Example 20
Project: JuggleMasterPro   File: ControlJFrame.java   View Source Code Vote up 4 votes
final private JPanel doAddMiddleWidgets() {

		// Middle panel :
		final JPanel objLmiddleJPanel = new JPanel(new GridBagLayout());
		objLmiddleJPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
		objLmiddleJPanel.setOpaque(true);

		// Height, dwell, speed & fluidity labels :
		final ExtendedGridBagConstraints objLmiddlePanelExtendedGridBagConstraints = new ExtendedGridBagConstraints(0, 0, 1, 1, 0, 0, 5, 3);
		objLmiddleJPanel.add(this.objGheightJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(0, 1);
		objLmiddleJPanel.add(this.objGdwellJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setMargins(0, 0, 0, 3);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(5, 0);
		objLmiddleJPanel.add(this.objGspeedJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(5, 1);
		objLmiddleJPanel.add(this.objGfluidityJLabel, objLmiddlePanelExtendedGridBagConstraints);

		// Height, dwell, speed & fluidity values :
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(3, 0);
		objLmiddleJPanel.add(this.objGheightValueJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(3, 1);
		objLmiddleJPanel.add(this.objGdwellValueJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(8, 0);
		objLmiddlePanelExtendedGridBagConstraints.setMargins(0, 0, 0, 0);
		objLmiddleJPanel.add(this.objGspeedValueJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(8, 1);
		objLmiddleJPanel.add(this.objGfluidityValueJLabel, objLmiddlePanelExtendedGridBagConstraints);

		// Height, speed, dwell & fluidity colons :
		objLmiddlePanelExtendedGridBagConstraints.setMargins(0, 0, 0, 3);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(1, 0);
		objLmiddleJPanel.add(this.objGheightColonsJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(6, 0);
		objLmiddleJPanel.add(this.objGspeedColonsJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(1, 1);
		objLmiddleJPanel.add(this.objGdwellColonsJLabel, objLmiddlePanelExtendedGridBagConstraints);
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(6, 1);
		objLmiddleJPanel.add(this.objGfluidityColonsJLabel, objLmiddlePanelExtendedGridBagConstraints);

		// Play/pause button :
		objLmiddlePanelExtendedGridBagConstraints.setGridBounds(4, 0, 1, 2);
		objLmiddlePanelExtendedGridBagConstraints.setMargins(0, 0, 3, 6);
		objLmiddleJPanel.add(this.objGplayPauseJButton, objLmiddlePanelExtendedGridBagConstraints);

		// Height scrollbar :
		objLmiddlePanelExtendedGridBagConstraints.setGridBounds(2, 0, 1, 1);
		objLmiddlePanelExtendedGridBagConstraints.setMargins(0, 0, 0, 3);
		objLmiddlePanelExtendedGridBagConstraints.setFilling(GridBagConstraints.HORIZONTAL, 0.5F, 0F);
		objLmiddleJPanel.add(this.objGheightJScrollBar, objLmiddlePanelExtendedGridBagConstraints);

		// Speed scrollbar :
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(7, 0);
		objLmiddleJPanel.add(this.objGspeedJScrollBar, objLmiddlePanelExtendedGridBagConstraints);

		// Dwell scrollbar :
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(2, 1);
		objLmiddleJPanel.add(this.objGdwellJScrollBar, objLmiddlePanelExtendedGridBagConstraints);

		// Fluidity scrollbar :
		objLmiddlePanelExtendedGridBagConstraints.setGridLocation(7, 1);
		objLmiddleJPanel.add(this.objGfluidityJScrollBar, objLmiddlePanelExtendedGridBagConstraints);

		return objLmiddleJPanel;
	}