public void initComponents() { Container c = this.getContentPane(); this.setTitle("Login Choice"); this.setSize(600, 500); this.setLayout(null); // button Vietnamese language btnVietnamese = new JButton("Tiếng Việt"); btnVietnamese.setSize(100, 25); btnVietnamese.setLocation(50, 100); c.add(btnVietnamese); // title JLabel lblTile = new JLabel("Choose login"); lblTile.setSize(200, 30); lblTile.setLocation(180, 100); lblTile.setFont(new Font("Arial", Font.BOLD, 30)); c.add(lblTile); // button English language btnEnglish = new JButton("English"); btnEnglish.setSize(100, 25); btnEnglish.setLocation(400, 100); c.add(btnEnglish); // radio button connect to database radConnect = new JRadioButton("Connect to Database"); radConnect.setSize(200, 20); radConnect.setLocation(100, 200); // radio button not connect to database radNotConnect = new JRadioButton("Not connect to database"); radNotConnect.setSize(200, 20); radNotConnect.setLocation(300, 200); // group radio buttons ButtonGroup group = new ButtonGroup(); group.add(radConnect); group.add(radNotConnect); c.add(radConnect); c.add(radNotConnect); // button connect btnConnect = new JButton("Connect"); btnConnect.setSize(100, 25); btnConnect.setLocation(50, 300); c.add(btnConnect); // button not connect btnNotConnect = new JButton("Not connect"); btnNotConnect.setSize(120, 25); btnNotConnect.setLocation(200, 300); c.add(btnNotConnect); // button login btnLogin = new JButton("Login"); btnLogin.setSize(100, 25); btnLogin.setLocation(370, 300); c.add(btnLogin); this.setVisible(true); }
public EmployeeCUDialog(JFrame owner, String title) { super(owner); this.setTitle(title); this.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.setLocation(500, 250); this.setSize(200, 300); this.setLayout(null); this.setModal(true); lblName = new JLabel("Name:"); this.add(lblName); lblName.setLocation(20, 10); lblName.setSize(100, 25); txfName = new JTextField(); this.add(txfName); txfName.setLocation(20, 35); txfName.setSize(150, 25); lblWage = new JLabel("Wage:"); this.add(lblWage); lblWage.setLocation(20, 70); lblWage.setSize(100, 25); txfWage = new JTextField(); this.add(txfWage); txfWage.setLocation(20, 95); txfWage.setSize(150, 25); lblCompany = new JLabel("Company:"); this.add(lblCompany); lblCompany.setLocation(20, 130); lblCompany.setSize(100, 25); cbxCompanies = new JComboBox<Company>(); this.add(cbxCompanies); cbxCompanies.setLocation(20, 155); cbxCompanies.setSize(150, 25); cbxCompanies.setMaximumRowCount(4); btnOk = new JButton("Ok"); this.add(btnOk); btnOk.setLocation(15, 225); btnOk.setSize(70, 25); btnOk.addActionListener(controller); btnCancel = new JButton("Cancel"); this.add(btnCancel); btnCancel.setLocation(95, 225); btnCancel.setSize(80, 25); btnCancel.addActionListener(controller); // initialise this view controller.fillCbxCompanies(); }
@Override public void mouseEntered(MouseEvent e) { Random r = new Random(); int x = r.nextInt(getWidth() - button.getWidth() - 50); int y = r.nextInt(getHeight() - button.getHeight() - 50); button.setLocation(x, y); }
public UpdaterSelectWizardPanel(UpdaterData data) { super(); data_ = data; setPreferredSize(new Dimension(500, 400)); addButtons(NEXT_BACK_CANCEL); setEnableButton(BUTTON_BACK, false); useHeaderPanel(HEADER, SUBHEADER, "/imc/lecturnity/converter/images/lecturnity_logo.gif"); getContentPanel().setLayout(null); JLabel desc = new JLabel(SELECT); desc.setFont(NORMAL_FONT); desc.setLocation(30, 100); desc.setSize(460, 15); getContentPanel().add(desc); presentationFileField_ = new JTextField(""); presentationFileField_.setFont(NORMAL_FONT); presentationFileField_.setLocation(30, 120); presentationFileField_.setSize(440, 22); getContentPanel().add(presentationFileField_); JButton findButton = new JButton(FIND); // if (imc.lecturnity.converter.ConverterWizard.USE_CUSTOM_COLORS) if (USE_CUSTOM_COLORS) findButton.setBackground(Wizard.BG_COLOR); findButton.setSize(120, 30); findButton.setLocation(30, 148); findButton.setMnemonic(MNEM_FIND); findButton.addActionListener(new FindButtonListener()); getContentPanel().add(findButton); }
private void init() { this.setMinimumSize(new Dimension(360, 200)); this.setPreferredSize(new Dimension(360, 200)); this.setSize(new Dimension(360, 200)); setUndecorated(true); lblTitle.setSize(new java.awt.Dimension(360, 20)); lblTitle.setLocation(new java.awt.Point(20, 20)); lblTitle.setVisible(true); Font bigFont = new Font(lblTitle.getFont().getName(), Font.BOLD, TITLE_FONT_SIZE); Font smallFont = new Font(lblTitle.getFont().getName(), Font.PLAIN, OTHER_FONT_SIZE); lblTitle.setFont(bigFont); lblTitle.setText("Processing ..."); lblNote.setSize(new java.awt.Dimension(360, 20)); lblNote.setLocation(new java.awt.Point(20, 60)); lblNote.setVisible(true); lblNote.setFont(smallFont); jpbProgressBar.setValue(0); jpbProgressBar.setSize(new Dimension(230, 20)); jpbProgressBar.setLocation(new java.awt.Point(60, 100)); jpbProgressBar.setStringPainted(true); jpbProgressBar.setString(""); jpbProgressBar.setIndeterminate(true); jpbProgressBar.setVisible(true); btnCancel.setSize(new java.awt.Dimension(90, 30)); btnCancel.setLocation(new java.awt.Point(135, 140)); btnCancel.setVisible(true); pnlContent.setLayout(null); pnlContent.add(lblTitle); pnlContent.add(lblNote); pnlContent.add(jpbProgressBar); pnlContent.add(btnCancel); pnlContent.setPreferredSize(new Dimension(360, 160)); pnlContent.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1)); getContentPane().add(pnlContent, BorderLayout.CENTER); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent we) { btnCancel.doClick(); } }); btnCancel.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { lblNote.setText("Cancelling..."); PromptListenerManager.fireTaskComplete(true); } }); }
/** * This method initializes jButtonPresidential * * @return javax.swing.JButton */ private JButton getJButtonPresidential() { if (jButtonPresidential == null) { jButtonPresidential = new JButton(); jButtonPresidential.setVerticalAlignment(SwingConstants.BOTTOM); jButtonPresidential.setVerticalTextPosition(SwingConstants.BOTTOM); jButtonPresidential.setLocation(new Point(800, 270)); jButtonPresidential.setSize(new Dimension(161, 151)); jButtonPresidential.setIcon( new ImageIcon(LobbySuite.class.getResource("/simplytech/image/PresidentialSuite.jpg"))); jButtonPresidential.setText("Presidential Suite"); jButtonPresidential.setHorizontalTextPosition(SwingConstants.CENTER); jButtonPresidential.setFont(new Font("Arial", Font.BOLD, 12)); jButtonPresidential.setBackground(new Color(91, 155, 213)); jButtonPresidential.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { JPanel panel = new PresidentialSuite(myFrame); myFrame.getContentPane().removeAll(); myFrame.getContentPane().add(panel); myFrame.getContentPane().validate(); myFrame.getContentPane().repaint(); } }); } return jButtonPresidential; }
private void showInfo() { clear_all(); JLabel lbl = new JLabel( "<html>Автор идеи - Илья Конжезёров<br>" + "Разработчик - Клим Парпеев<br>" + "Музыка:<ul>" + "<li>Яков Филин – Interlude</li>" + "<li>Duck Sause – NRG</li>" + "<li>Knife Party – EDM Trend Machine</li>" + "<li>Jack U – Take U There (feat. Kiesza)</li>" + "<li>Cash Cash – Kiss the Sky<br></li></ul>" + "Happy Baby Production<br>" + "The NIPEL Inc. (c) 2015</html>"); lbl.setFont(new Font("serif", 0, 25)); lbl.setForeground(Color.WHITE); lbl.setSize(700, 500); lbl.setLocation(Commons.WIDTH / 2 - 700 / 2, 10); add(lbl); JButton back = new JButton("Назад"); back.setSize(190, 75); back.setLocation(Commons.WIDTH / 2 - 190 / 2, Commons.HEIGHT - 150); back.setForeground(Color.GREEN); back.setBorderPainted(false); back.setFocusPainted(false); back.setContentAreaFilled(false); back.setFont(new Font("serif", 0, 40)); back.addActionListener(ev -> showMainMenu()); add(back); repaint(); }
private void settingSizes() { panel.setPreferredSize(new Dimension(830, 500)); sBtn.setSize(225, 45); rBtn.setSize(225, 45); ofBtn.setSize(225, 65); inputScroll.setSize(770, 180); nsBtn.setSize(225, 45); logScroll.setSize(535, 245); sBtn.setLocation(580, 225); rBtn.setLocation(580, 285); ofBtn.setLocation(580, 345); nsBtn.setLocation(580, 425); logScroll.setLocation(30, 225); inputScroll.setLocation(30, 30); }
/** * This method initializes dirB * * @return javax.swing.JButton */ private JButton getDirB() { if (dirB == null) { dirB = new JButton(); dirB.setLocation(new Point(4, 1)); dirB.setSize(new Dimension(16, 16)); } return dirB; }
/** * This method initializes noteB * * @return javax.swing.JButton */ private JButton getNoteB() { if (noteB == null) { noteB = new JButton(); noteB.setLocation(new Point(42, 1)); noteB.setSize(new Dimension(16, 16)); } return noteB; }
/** * This method initializes linkB * * @return javax.swing.JButton */ private JButton getLinkB() { if (linkB == null) { linkB = new JButton(); linkB.setLocation(new Point(23, 1)); linkB.setSize(new Dimension(16, 16)); } return linkB; }
public RightPanel(JPanel parent) { setLayout(null); setSize(180, 180); x = (parent.getWidth() - getWidth()); y = 460; setLocation(x, y); initButton(startbtn, startListen); startbtn.setLocation(0, 45); startbtn.setSize(150, 28); add(startbtn); initButton(returnbtn, returnListen); returnbtn.setLocation(0, 75); returnbtn.setSize(150, 28); add(returnbtn); }
public void guisetup() { frame = new JFrame("Screenshot Gatherer"); // frame.setFocusable(false); frame.setLayout(null); frame.setSize(1000, 600); // frame.setVisible(true); matchCount = new JLabel(); matchCount.setLocation(0, 0); matchCount.setSize(150, 30); picLabel = new JLabel(); picLabel.setLocation(0, 30); picLabel.setSize(600, 550); frame.add(picLabel); // picLabel.repaint(); frame.add(matchCount); updateMatchCount(); textArea = new JTextPane(); textArea.setLocation(0, 0); textArea.setSize(200, 600); JScrollPane scrollable = new JScrollPane(textArea); scrollable.setLocation(600, 0); scrollable.setSize(200, 600); scrollable.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); frame.add(scrollable); textAreaSeen = new JTextPane(); textAreaSeen.setLocation(0, 0); textAreaSeen.setSize(200, 600); JScrollPane scrollable2 = new JScrollPane(textAreaSeen); scrollable2.setLocation(800, 0); scrollable2.setSize(200, 600); scrollable2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // frame.add(textArea); frame.add(scrollable2); recordingCheckbox = new JCheckBox(); recordingCheckbox.setLocation(150, 0); recordingCheckbox.setSize(270, 30); recordingCheckbox.setText("Automatically Save Screenshots"); frame.add(recordingCheckbox); saveScreenshotButton = new JButton(); saveScreenshotButton.setLocation(420, 0); saveScreenshotButton.setSize(180, 30); saveScreenshotButton.setText("Save Screenshot"); frame.add(saveScreenshotButton); }
public void askDifficulty() { // hides everything but the things needed to be on the screen started = false; playing = false; instructionLabel.setVisible(true); difficultyLabel.setVisible(true); exitButton.setVisible(true); exitButton.setLocation((bWidth * 4) + 200, 450); for (int i = 0; i < 4; i++) { switch (i) { case (0): difficultyButton[i].setText("Easy"); break; case (1): difficultyButton[i].setText("Medium"); break; case (2): difficultyButton[i].setText("Hard"); break; case (3): difficultyButton[i].setText("Insane"); break; } difficultyButton[i].setVisible(true); } for (int i = 0; i < projectileAmount; i++) { enemyProj[i].setVisible(false); } for (int i = 0; i < livesImages.length; i++) { livesImages[i].setVisible(false); } playerLabel.setVisible(false); scoreLabel.setVisible(false); playerProj.setVisible(false); resetButton.setVisible(false); player.setVisible(false); outcomeLabel.setVisible(false); tickLabel.setVisible(false); shield.setVisible(false); ceiling.setVisible(false); floor.setVisible(false); for (int y = 0; y < 4; y++) { for (int x = 0; x < 10; x++) { enemies[y][x].setVisible(false); } } }
public void doLayout() { if (isStuck()) { Dimension size = getSize(); Dimension unStickSize = unstickButton.getPreferredSize(); int x = size.width - unStickSize.width; int y = size.height / 2 - unStickSize.height / 2; unstickButton.setSize(unStickSize); unstickButton.setLocation(x, y); } }
/** Construtor da classe */ @SuppressWarnings("static-access") public JanelaSegmentacaoAdaptativa() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } dimensao = 0; setSize(200, 180); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); setLocation(d.width / 2 - 200 / 2, d.height / 2 - 180 / 2); setDefaultCloseOperation(this.DISPOSE_ON_CLOSE); setTitle("Segmentação Adaptativa"); setLayout(null); setModal(true); setResizable(false); informar = new JLabel("Informar"); informar.setBounds(10, 18, 100, 20); label = new JLabel("Limiar para Dimensão:"); label.setBounds(10, 50, 170, 20); label2 = new JLabel("(Valor maior que 0)"); label2.setBounds(15, 70, 170, 20); text = new JTextField(); text.setBounds(150, 50, 35, 20); ok = new JButton("OK"); ok.setBounds(20, 110, 57, 25); ok.addActionListener(this); cancelar = new JButton("Cancelar"); cancelar.setBounds(90, 110, 85, 25); cancelar.addActionListener(this); ajuda = new AjudaButton(); ajuda.setActionCommand("?"); ajuda.setLocation(170, 0); ajuda.addActionListener(this); getContentPane().add(informar); getContentPane().add(label); getContentPane().add(label2); getContentPane().add(text); getContentPane().add(ok); getContentPane().add(cancelar); getContentPane().add(ajuda); text.setText(""); dimensao = -1; text.addKeyListener(this); ok.addKeyListener(this); cancelar.addKeyListener(this); ajuda.addKeyListener(this); setVisible(true); }
public Abschluss(String wahl, Sudoku s, Sudoku2 s2) { super("Sudoku-Abschluss"); this.setSize(270, 135); this.setLocation(250, 300); this.setLayout(null); this.setAlwaysOnTop(true); this.setResizable(false); this.setUndecorated(true); if (s == null) this.setLocationRelativeTo(s2); else this.setLocationRelativeTo(s); su = s; su2 = s2; w = wahl; ImageIcon icon = new ImageIcon("files/minigames/Sudoku/beispiel2.jpg"); icon.setImage(icon.getImage().getScaledInstance(290, 135, Image.SCALE_DEFAULT)); lab = new JLabel(icon); lab.setSize(270, 135); lab.setLocation(0, 0); this.add(lab); text = new JLabel(); text.setSize(250, 20); text.setLocation(10, 10); text.setForeground(Color.white); text.setHorizontalAlignment(0); lab.add(text); text2 = new JLabel(); text2.setSize(270, 20); text2.setLocation(10, 30); text2.setForeground(Color.white); lab.add(text2); ok = new JButton("OK"); ok.setSize(90, 30); ok.setLocation(80, 50); ok.setBorderPainted(false); ok.setBackground(Color.lightGray); ok.setForeground(Color.lightGray); ok.setOpaque(false); ok.setFont(new Font("Arial Black", 4, 20)); ok.setContentAreaFilled(false); ok.setFocusPainted(false); ok.addActionListener(this); ok.addMouseListener(this); lab.add(ok); textWahl(wahl); this.setVisible(true); }
public MainFrame() { Service.createAndStoreSomeObjects(); pnlContent = (JPanel) this.getContentPane(); pnlContent.setLayout(null); pnlScreen = new JPanel(); pnlContent.add(pnlScreen); pnlScreen.setSize(300, 380); pnlScreen.setLocation(10, 10); pnlScreen.setLayout(null); pnlButtons = new JPanel(); pnlContent.add(pnlButtons); pnlButtons.setSize(300, 60); pnlButtons.setLocation(10, 400); pnlButtons.setLayout(null); btnHome = new JButton("Home"); pnlButtons.add(btnHome); btnHome.setSize(70, 30); btnHome.setLocation(115, 10); btnHome.addActionListener(controller); // --------------------------------------------------------------------- Color color = new Color(99, 184, 255); // steelblue pnlMain = new MainPanel(this); pnlMain.setName("Main"); pnlMain.setBackground(color); pnlMain.setLayout(null); pnlScreen.add(pnlMain, "Main"); pnlTexts = new TextsPanel(this); pnlTexts.setName("Texts"); pnlScreen.add(pnlTexts, "Texts"); pnlTexts.setBackground(color); pnlTexts.setLayout(null); pnlCalls = new CallsPanel(this); pnlCalls.setName("Calls"); pnlScreen.add(pnlCalls, "Calls"); pnlCalls.setBackground(color); pnlCalls.setLayout(null); pnlContacts = new ContactsPanel(this); pnlContacts.setName("Contacts"); pnlScreen.add(pnlContacts, "Contacts"); pnlContacts.setBackground(color); pnlContacts.setLayout(null); showPanel("Main"); }
/** * <div>Por este método agraremos todos los botones que están en la lista al panel con la * ubicación y el tamaño.</div> * * @param lista (tipo ArrayList<JButton>)Lista de botones. */ private void agregarComponentesOrdenados(JTextField txtField, JButton bttn) { // Atributos Locales // Cuerpo del método if (txtField != null && bttn != null) { this.agregarComponentes(txtField, bttn); txtField.setLocation(0, 0); txtField.setSize(300, 50); bttn.setLocation(301, 0); bttn.setSize(100, 50); } // Fin del if (txtField != null && bttn != null) }
private void showShopMenu() { clear_all(); add(money); JButton skins = new JButton("Скины"); skins.setSize(500, 75); skins.setLocation(Commons.WIDTH / 2 - (500 / 2), 200); skins.setContentAreaFilled(false); skins.setForeground(Color.GREEN); skins.setFont(new Font("arial", 0, 40)); skins.addActionListener(e -> showSkinMenu()); skins.setBorderPainted(false); skins.setFocusPainted(false); add(skins); JButton bg = new JButton("Задний фон"); bg.setSize(500, 75); bg.setLocation(Commons.WIDTH / 2 - (500 / 2), 400); bg.setContentAreaFilled(false); bg.setForeground(Color.GREEN); bg.setFont(new Font("arial", 0, 40)); bg.addActionListener(e -> showShopMenu()); bg.setBorderPainted(false); bg.setFocusPainted(false); add(bg); JButton back = new JButton("Назад"); back.setSize(190, 75); back.setLocation(Commons.WIDTH / 2 - 190 / 2, Commons.HEIGHT - 150); back.setForeground(Color.GREEN); back.setBorderPainted(false); back.setFocusPainted(false); back.setContentAreaFilled(false); back.setFont(new Font("serif", 0, 40)); back.addActionListener(ev -> showMainMenu()); add(back); }
private void init() { setSize(800, 600); cp = getContentPane(); cp.setLayout(null); btnResize.addActionListener(this); btnResize.setLocation(0, 0); btnResize.setSize(100, 30); sp.setLocation(0, 31); sp.setBorder(BorderFactory.createLineBorder(Color.blue, 2)); editorPane.setBorder(BorderFactory.createLineBorder(Color.red, 2)); step.setLocation(0, 31); step.setSize(100, 100); cp.add(step); // cp.add(sp); cp.add(btnResize); }
/** * <div> Agregamos los componentes ordenados según el tamaño del panel. * * <p>Definimos que el botón de borrado tendrá 80pxl, el resto se calcula en base al tamaño del * panel. </div> * * @param txtField (Tipo JTextField) Es el display o pantalla. * @param bttn (Tipo JButton) Es el botón de borrado. * @param iTamPanelX (Tipo int) Tamaño del panel con respecto del eje X, o tamaño horizontal. * @param iTamPanelY (Tipo int) Tamaño del panel con respecto del eje Y, o tamaño vertical. */ private void agregarComponentesOrdenados( JTextField txtField, JButton bttn, int iTamPanelX, int iTamPanelY) { // Atributos Locales int iTamBotonClearX = 80; // Cuerpo del método if (txtField != null && bttn != null) { this.agregarComponentes(txtField, bttn); txtField.setLocation(0, 0); txtField.setSize(iTamPanelX - iTamBotonClearX, iTamPanelY - 1); bttn.setLocation(txtField.getWidth(), 0); bttn.setSize(iTamBotonClearX, iTamPanelY - 1); } // Fin del if (txtField != null && bttn != null) }
public JButton Sleep() { JButton button = new JButton("Затемнить"); button.setVisible(true); button.setLocation(500, 500); button.setPreferredSize(new Dimension(290, 130)); button.setFont(new Font("TimesRoman", Font.PLAIN, 40)); button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame f1 = new JFrame(); UIManager.put(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0); Color c = new Color(0, 0, 0); Container con = f1.getContentPane(); con.setBackground(c); f1.addMouseMotionListener( new MouseMotionAdapter() { public void mouseDragged(MouseEvent evt) { f1.dispose(); } }); f1.addMouseListener( new MouseListener() { public void mousePressed(MouseEvent e) { f1.dispose(); } public void mouseReleased(MouseEvent e) { f1.dispose(); } public void mouseClicked(MouseEvent e) {} public void mouseExited(MouseEvent e) {} public void mouseEntered(MouseEvent e) {} }); f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Toolkit kit = Toolkit.getDefaultToolkit(); f1.setLocation( (kit.getScreenSize().width - 300) / 2, (kit.getScreenSize().height - 300) / 2); f1.setUndecorated(true); f1.setVisible(true); f1.setExtendedState(JFrame.MAXIMIZED_BOTH); } }); return button; }
public Dnfinder(String title) { super(); setLayout(new FlowLayout()); setSize(300, 300); setLayout(null); field = new JTextField(); field.setSize(100, 20); field.setLocation(20, 20); field.setText("tra*ian*"); this.add(field); button = new JButton("run"); button.setSize(100, 20); button.setLocation(140, 20); button.addActionListener(this); this.add(button); }
private JButton getCancelarButton() { if (cancelarButton == null) { cancelarButton = new JButton(); cancelarButton.setLocation(new Point(243, 130)); cancelarButton.setBackground(Color.white); cancelarButton.setName(""); cancelarButton.setSelected(false); cancelarButton.setText("Cancelar"); cancelarButton.setSize(new Dimension(85, 20)); cancelarButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); } }); } return cancelarButton; }
/** * Construtor da classe * * @param mensagem A mensagem de texto a ser exibida */ public JanelaSair(String mensagem) { super(); Sound.play("alerta.wav"); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } acaoSelecionada = ""; Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); int screenHeight = d.height; int screenWidth = d.width; setLocation(screenWidth / 2 - 200 / 2, screenHeight / 2 - 123 / 2); setSize(200, 123); setTitle("Atenção!"); setLayout(null); setModal(true); setResizable(false); label = new JLabel(mensagem); label.setBounds(55, 18, 280, 15); icone = new JLabel(new ImageIcon("Resource/Icones/aviso.gif")); icone.setBounds(10, 10, 32, 32); salvar = new JButton("Sim"); salvar.setBounds(45, 50, 55, 25); salvar.addActionListener(this); naoSalvar = new JButton("Não"); naoSalvar.setBounds(109, 50, 55, 25); naoSalvar.addActionListener(this); ajuda = new AjudaButton(); ajuda.setActionCommand("?"); ajuda.setLocation(170, 0); ajuda.addActionListener(this); getContentPane().add(label); getContentPane().add(icone); getContentPane().add(salvar); getContentPane().add(naoSalvar); getContentPane().add(ajuda); addWindowListener(this); salvar.addKeyListener(this); naoSalvar.addKeyListener(this); ajuda.addKeyListener(this); setVisible(true); }
public GraphicsUI() { questionPool = new QuestionPool(); setTitle("Question Pool"); setSize(WIDTH, HEIGHT); fileL = new JLabel("Location of Question Pool File:"); fileTF = new JTextField(10); checkB = new JButton("Check File"); log = new JTextArea(6, 30); Container pane = getContentPane(); pane.setLayout(null); // set locations and sizes for the elements fileL.setLocation(90, 15); fileL.setSize(ELEMENT_WIDTH, 30); fileTF.setLocation(90, 65); fileTF.setSize(ELEMENT_WIDTH, 30); checkB.setLocation(90, 105); checkB.setSize(300, 35); log.setLocation(90, 145); log.setSize(300, 30); // add listener to button CheckButtonHandler cbHandler = new CheckButtonHandler(); checkB.addActionListener(cbHandler); fileTF.addActionListener(cbHandler); // add elements to pane pane.add(fileL); pane.add(fileTF); pane.add(checkB); pane.add(log); setLocation(100, 60); setVisible(true); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); }
private JButton getAceptarButton() { if (aceptarButton == null) { aceptarButton = new JButton(); aceptarButton.setLocation(new Point(138, 130)); aceptarButton.setBackground(Color.white); aceptarButton.setName(""); aceptarButton.setText("Aceptar"); aceptarButton.setSize(new Dimension(79, 20)); aceptarButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { if (comprobarCondiciones()) { flagAceptar = true; setVisible(false); } } }); } return aceptarButton; }
public UploadMM(ArrayList<SlideData> sList, MindMapController mc) { setSize(300, 150); setLayout(null); this.sList = (ArrayList<SlideData>) sList.clone(); this.mc = mc; btnListner = new UploadListner(); JLabel ID = new JLabel("ID : "); JLabel passwd = new JLabel("Password : "******"Upload"); upBtn.setSize(90, 30); upBtn.setLocation(140, 75); upBtn.addActionListener(btnListner); add(upBtn); IDTf = new JTextField(); IDTf.setSize(100, 20); IDTf.setLocation(130, 20); passwdTf = new JPasswordField(); passwdTf.setSize(100, 20); passwdTf.setLocation(130, 50); add(IDTf); add(passwdTf); setTitle("Login for upload"); setVisible(true); setLocation(400, 400); }
public void initGUI() { JLabel downloadXAMPP = new JLabel(main.getConf().getlProp().getProperty("label.downloadXAMPP")); downloadXAMPP.setLocation(10, 10); downloadXAMPP.setSize(600, 20); this.add(downloadXAMPP); JLabel downloadXAMPP2 = new JLabel(main.getConf().getlProp().getProperty("label.downloadXAMPP2")); downloadXAMPP2.setLocation(10, 50); downloadXAMPP2.setSize(600, 20); this.add(downloadXAMPP2); JLabel downloadXAMPP3 = new JLabel(main.getConf().getlProp().getProperty("label.downloadXAMPP3")); downloadXAMPP3.setLocation(10, 90); downloadXAMPP3.setSize(600, 20); this.add(downloadXAMPP3); this.add(downloadXAMPP); JButton downloadButton = new JButton(main.getConf().getlProp().getProperty("button.download")); downloadButton.setLocation(10, 130); downloadButton.setSize(70, 20); this.add(downloadButton); downloadButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { main.getStatusService().getAkt().setStatus(1); main.getUrlService().openURL("XAMPP"); } }); }