public static void main(String[] args) { JFrame mainFrame = new JFrame("TestPopupWindow"); mainFrame.getContentPane().add(new TestPopupWindow()); mainFrame.pack(); mainFrame.setLocationRelativeTo(null); mainFrame.setVisible(true); }
Main() { f = new JFrame("Wiki Seach"); JPanel p = new JPanel(); JPanel p1 = new JPanel(); b = new JButton("Search"); b1 = new JButton("Exit"); t = new JTextField(30); b.addActionListener(this); b1.addActionListener(this); p1.add(b); p1.add(b1); p.add(t); f.setLayout(new GridLayout(2, 1)); f.add(p); f.add(p1); f.pack(); f.setLocationRelativeTo(null); f.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); f.setVisible(true); }
public static void main(String[] args) { final JPopupMenu menu = new JPopupMenu(); menu.setLayout(new GridLayout(0, 3, 5, 5)); final MenuedButton button = new MenuedButton("Icons", menu); for (int i = 0; i < 9; i++) { // replace "print.gif" with your own image final JLabel label = new JLabel("" + i); // new ImageIcon("resources/images/print.gif") ); label.addMouseListener( new MouseAdapter() { public void mouseClicked(MouseEvent e) { button.getMainButton().setIcon(label.getIcon()); menu.setVisible(false); } }); menu.add(label); } JFrame frame = new JFrame("Button Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new JLabel("Click Arrow Button To Show Popup"), BorderLayout.NORTH); frame.getContentPane().add(button, BorderLayout.CENTER); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void go() throws IOException { // DefaultRouteTable route = new DefaultRouteTable(); // System.out.println(route.routeInfo()); // route.routeInfo(); totalSize = Toolkit.getDefaultToolkit().getScreenSize(); // getting screen size int width = totalSize.width; int height = totalSize.height; frame = new JFrame(); // creating frame frame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent we) { FileInput data = null; try { data = new FileInput("input.txt"); } catch (Exception e) { } String[][] origRoutes = convertArrayListTo2DArray(data.routeArrayList(data.routesToken), 1); String[][] routesList = Main.convertArrayListTo2DArray(routesInfo, 1); Main.changesCheck(origRoutes, routesList); } }); frame.setTitle("Air Route Planner"); frame.add(Panels()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize((width * 3 / 4), (height * 3 / 4)); frame.setJMenuBar(menuBar()); frame.setResizable(false); frame.setVisible(true); frame.setLocationRelativeTo(null); }
/** Main method */ public static void main(String[] args) { JFrame frame = new SimpleEventDemo2(); frame.setTitle("SimpleEventDemo2"); frame.setLocationRelativeTo(null); // Center the frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(100, 80); frame.setVisible(true); }
public void Window() { JFrame f = new JFrame("test"); f.setSize(570, 383); f.add(new test()); f.setLocationRelativeTo(null); f.setResizable(false); f.setVisible(true); }
public static void main(String args[]) { JFrame frame = new CopyFileToTable(); frame.setTitle("CopyFileToTable"); frame.setSize(700, 200); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); }
/** Main method */ public static void main(String[] args) { JFrame frame = new JFrame("ClockAnimation"); ClockAnimation clock = new ClockAnimation(); frame.add(clock); frame.setLocationRelativeTo(null); // Center the frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(200, 200); frame.setVisible(true); }
/** Constructs the browser as a standalone frame. */ private void constructStandalone() { frame = new JFrame("Issues"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(1024, 600); frame.setLocationRelativeTo(null); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(constructView(), BorderLayout.CENTER); frame.setVisible(true); }
public static void main(String[] args) { JFrame frame = new JFrame("AVLTreeAnimation"); JApplet applet = new AVLTreeAnimation(); frame.add(applet); frame.setSize(500, 300); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); }
private static void createAndShowMain() { JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("RT Prune Algorithm Simulator"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); Main newContentPane = new Main(frame); newContentPane.setOpaque(true); frame.setContentPane(newContentPane); frame.pack(); frame.setExtendedState(Frame.MAXIMIZED_BOTH); frame.setVisible(true); }
public static void main(String[] args) { ProgressBarDemo applet = new ProgressBarDemo(); JFrame frame = new JFrame(); frame.setTitle("ProgressBarDemo"); frame.getContentPane().add(applet, BorderLayout.CENTER); applet.init(); applet.start(); frame.setSize(400, 200); frame.setLocationRelativeTo(null); // Center the frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); }
public static void main(String[] args) { sccolorlight demo = new sccolorlight(); // JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("sccolorlight"); frame.setSize(500, 500); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(demo.drawable); frame.setVisible(true); demo.drawable.requestFocusInWindow(); }
public static void main(String[] args) { MojamComponent mc = new MojamComponent(); JFrame frame = new JFrame(); JPanel panel = new JPanel(new BorderLayout()); panel.add(mc); frame.setContentPane(panel); frame.pack(); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); mc.start(); }
public GUI() { frame.setSize(500, 450); frame.setResizable(false); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); teksti.setEditable(false); loki = new JScrollPane(teksti); frame.setLocationRelativeTo(null); asetaLayout(); panelv.setLayout(layout); frame.setLayout(new BorderLayout()); frame.add(panelv, BorderLayout.WEST); frame.add(panelo, BorderLayout.CENTER); frame.setVisible(true); }
/** Create the entire GUI from scratch */ private void createGUI() { clientFrame = new JFrame("LeetFTP"); // Allow program to exit gracefully clientFrame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); createTabs(); createMenu(); // Top Options Bar connectButton = new JButton("Connect"); connectButton.addMouseListener(mouseHandler); optionPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); optionPanel.add(connectButton); optionPanel.add(new JLabel("Name Server Hostname")); optionPanel.add(serverTextField); optionPanel.add(new JLabel("Port #")); optionPanel.add(portTextField); optionPanel.add(new JLabel("UserName")); optionPanel.add(nameTextField); // Bottom Transfer Table transferTable = new JTable(); transferPanel = new JPanel(new BorderLayout()); transferPanel.add(new JLabel("Current Transfers:"), BorderLayout.NORTH); transferPanel.add(transferTable); // Make the tab pane the GUI pane clientFrame.getContentPane().setLayout(new BorderLayout()); clientFrame.getContentPane().add(mainPanel); clientFrame.getContentPane().add(optionPanel, BorderLayout.NORTH); clientFrame.getContentPane().add(transferPanel, BorderLayout.SOUTH); // Set Client Window Properties clientFrame.setSize(800, 600); // clientFrame.setResizable(false); clientFrame.setLocationRelativeTo(null); clientFrame.setVisible(true); }
public Fenetre() { frame = new JFrame(); frame.setTitle("Gestion Sauvegarde Serveur"); frame.setSize(700, 600); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setIconImage( Toolkit.getDefaultToolkit().getImage(getClass().getResource("/go-home.png"))); frame.setResizable(true); frame.setLocationRelativeTo(null); frame.setUndecorated(false); frame.setBackground(Color.white); frame.setContentPane(contentPane()); frame.setVisible(true); }
private void createAndShowGUI() { DrawingPanel panel = new DrawingPanel(); // JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("Hex Testing | Vlady"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container content = frame.getContentPane(); content.add(panel); // this.add(panel); -- cannot be done in a static context // for hexes in the FLAT orientation, the height of a 10x10 grid is 1.1764 * the width. (from h // / (s+t)) frame.setSize((int) (SCRSIZE / 1.23), SCRSIZE); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public static void main(String[] args) { JFrame frame = new JFrame("Network Tables"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); Display display = new Display(); frame.getContentPane().add(display); frame.setLocation(0, 0); frame.setSize(new Dimension(2000, 700)); frame.revalidate(); frame.repaint(); frame.setVisible(true); }
public static void createAndShowGUI() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } JFrame frame = new JFrame("@title@"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.getContentPane().add(new MainPanel()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public PeopleOptionPane(final String nick, final Controll controll, final ServerConnection c) { this.c = c; this.controll = controll; // frame = new JFrame(); panel.setBackground(Color.LIGHT_GRAY); frame.setContentPane(panel); frame.setSize(500, 500); frame.setLocationRelativeTo(null); frame.setResizable(false); frame.setVisible(true); addToFriendsButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String IP = c.getIpForNick(nick); controll.addToContacts(nick, IP); } }); callButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { controll.connect(getFriendLabel()); if (!Controll.isCalling) { JOptionPane.showMessageDialog(frame, controll.getTextFromArray(Controll.arrayList)); } else { DialogWindow dialogWindow = new DialogWindow(getFriendLabel()); dialogWindow.setControll(controll); dialogWindow.setTextOnLabel(nick); } } }); backButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { frame.setVisible(false); controll.setVisibleFrame("UserWindow", true); } }); }
public static void main(String s[]) { JFrame frame = new JFrame("Exportator"); AppExport panel = new AppExport(); frame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); Image im = Toolkit.getDefaultToolkit().getImage("images/ExportIco.jpg"); frame.setIconImage(im); frame.getContentPane().add(panel, "Center"); frame.setSize(panel.getPreferredSize()); frame.setVisible(true); frame.setResizable(false); frame.setLocationRelativeTo(null); }
// main test method public static void main(String[] args) { JFrame testFrame = new JFrame(); testFrame.setLayout(new GridLayout(2, 2)); MineButton button1 = new MineButton(); MineButton button2 = new MineButton(); MineButton button3 = new MineButton(); MineButton button4 = new MineButton(); button2.setType(MineButton.MINE); button3.setNumber(5); ; testFrame.add(button1); testFrame.add(button2); testFrame.add(button3); testFrame.add(button4); testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); testFrame.pack(); testFrame.setLocationRelativeTo(null); testFrame.setVisible(true); }
Slideshow(String images[]) { // transfer array of images into local array imagePaths = images; // create the frame and set its size, layout, location, and close operation frame = new JFrame("Slideshow"); frame.setSize(800, 600); frame.setLayout(new BorderLayout()); frame.setLocationRelativeTo(frame); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // create center and play/stop buttons centerButton = new JButton("center"); PlayStopButton = new JButton("Play"); // set actionListener for timer timer = new Timer(seconds, this); timer.setActionCommand("timer"); // set actionListener for the Play/Stop button PlayStopButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ae) { if (PlayStopButton.getText() == "Play") { PlayStopButton.setText("Stop"); timer.start(); } else if (PlayStopButton.getText() == "Stop") { PlayStopButton.setText("Play"); timer.stop(); } } }); // add the JLabel to the JScrollPane image = new JLabel(""); scrollPane = new JScrollPane(image); // add everything to the frame and display it frame.add(scrollPane); frame.add(PlayStopButton, BorderLayout.SOUTH); frame.setVisible(true); }
JFrame openMonitorGUI(String title) { try { MonitorGUI gui = new MonitorGUI(this, title); JFrame frame = new JFrame(title); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.addWindowListener(this); frame.getContentPane().add(gui); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Rectangle r = ge.getMaximumWindowBounds(); frame.setSize(400, 200); frame.setLocationRelativeTo(null); frame.pack(); frame.setVisible(true); return frame; } catch (Exception e) { System.out.println("9\b" + getClass().getName() + "\n\t" + e); return null; } }
/** * Constructor del juego que inicializa los valores. * * @param juga * @param jugadorActual */ public Juego(ArrayList<Jugador> juga, Jugador jugadorActual) { jugadores = new ArrayList<>(); this.jugadores = juga; this.jugador = jugadorActual; loader = Juego.class.getClassLoader(); utilidades = new Util(); claseTime = new Time(); ventana = new JFrame("Concéntrese - Juan S."); ventana.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ventana.setSize(520, 475); ventana.setLayout(null); ventana.setResizable(false); contadorJugadas = 0; cartaPorDefecto = new ImageIcon(loader.getResource("recursos/carta8.gif")); panel = new JPanel(); panel.setSize(300, 450); panel.setLayout(new GridLayout(4, 4)); intentos = new JLabel("Intento : 0"); etiquetaTiempoPartida = new JLabel("Tiempo: "); tiempoPartida = new JLabel("00.00.000"); etiquetaTiempoPartida.setFont(etiquetaTiempoPartida.getFont().deriveFont(20.0f)); tiempoPartida.setFont(tiempoPartida.getFont().deriveFont(20.0f)); intentos.setFont(intentos.getFont().deriveFont(20.0f)); intentos.setBounds(320, 50, 200, 30); tiempoPartida.setBounds(420, 5, 200, 30); etiquetaTiempoPartida.setBounds(320, 5, 200, 30); ventana.add(tiempoPartida); ventana.add(etiquetaTiempoPartida); ventana.add(intentos); ventana.add(panel); crearMenuSuperior(); crearMatrizIconos(); crearArrayBotones(); crearTemporizador(); ventana.setLocationRelativeTo(null); ventana.setVisible(true); }
public static void main(String[] args) { JFrame frame = new JFrame(); Molecule molecule = new Molecule("H"); SiteType[] type = new SiteType[Colors.COLORARRAY.length]; for (int i = 0; i < type.length; i++) { type[i] = new SiteType(molecule, "Type " + i); type[i].setRadius(1 + 0.5 * (i % 3)); type[i].setColor(Colors.COLORARRAY[i]); molecule.addType(type[i]); } Site[] site = new Site[3 * type.length]; for (int i = 0; i < site.length; i++) { site[i] = new Site(molecule, type[i % type.length]); site[i].setX(30 * Math.cos(2 * Math.PI * i / site.length)); site[i].setY(30 * Math.sin(2 * Math.PI * i / site.length)); site[i].setZ(6); site[i].setLocation(SystemGeometry.INSIDE); molecule.addSite(site[i]); } Link[] link = new Link[site.length - 1]; for (int i = 0; i < link.length; i++) { link[i] = new Link(site[i], site[i + 1]); molecule.addLink(link[i]); } DrawPanel3D panel3d = new DrawPanel3D(molecule); DrawPanel3DPanel panel = new DrawPanel3DPanel(panel3d); Container c = frame.getContentPane(); c.add(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setSize(600, 400); frame.setVisible(true); }
public static void createAndShowGUI() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } JFrame frame = new JFrame("@title@"); frame.setIconImages( Arrays.asList( makeBufferedImage(new StarIcon(), 16, 16), makeBufferedImage(new StarIcon(16, 8, 5), 40, 40))); // frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); // frame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.getContentPane().add(new MainPanel(frame)); frame.setResizable(false); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public static void createAndShowGUI() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } // UIManager.put("AuditoryCues.playList", UIManager.get("AuditoryCues.allAuditoryCues")); // UIManager.put("AuditoryCues.playList", UIManager.get("AuditoryCues.defaultCueList")); // UIManager.put("AuditoryCues.playList", UIManager.get("AuditoryCues.noAuditoryCues")); UIManager.put("AuditoryCues.playList", OPTION_PANE_AUDITORY_CUES); // UIManager.put("OptionPane.informationSound", "/example/notice2.wav"); // UIManager.put("OptionPane.informationSound", "sounds/OptionPaneError.wav"); // System.out.println(UIManager.get("AuditoryCues.actionMap")); JFrame frame = new JFrame("@title@"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.getContentPane().add(new MainPanel()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
/** Initialize the contents of the frame. */ private void initialize() { frmSignIn = new JFrame("Login"); frmSignIn.setTitle("Sign in"); frmSignIn.setResizable(false); frmSignIn.setBounds(100, 100, 450, 357); frmSignIn.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frmSignIn.setLocationRelativeTo(null); JLabel lblEmail = new JLabel("Email:"); lblEmail.setBounds(73, 108, 56, 18); JLabel lblPassword = new JLabel("Password:"******"Show Password"); chckbxShowPassword.setBounds(130, 176, 128, 23); frmSignIn.getContentPane().add(chckbxShowPassword); chckbxShowPassword.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { passwordField.setEchoChar((char) 0); } else { passwordField.setEchoChar(a); } } }); JButton btnNewButton = new JButton("Sign in"); btnNewButton.setBounds(325, 106, 72, 62); btnNewButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { username = textField.getText(); String password = String.valueOf(passwordField.getPassword()); // getText() // is // deprecated; // changed // to // getPassword() // password.toLowerCase(); Do we want case sensitive email? /* * SHA implementation to validate password */ VaultController v = new VaultController(); int result = 0; try { result = v.loginCheck(username, password); } catch (NoSuchAlgorithmException e1) { e1.printStackTrace(); } if (result == 1) { failedattempt = 0; frmSignIn.dispose(); } else { txtWarning.setText("The Email and/or Password is incorrect. Please try again."); failedattempt++; } // TODO migrate failcheck to Vault controller! if (failedattempt > 1 && failedattempt < 5) { try { VaultController.Send( "sentineldatavault", "SENTINELDATA", username, "Security Warning", "Dear user,\n\nYou have multiple failed login attempts for your account.\n" + "If it is not you, please change your password immediately.\n\n" + "Sincerely,\nSentinel Data Vault Team"); } catch (AddressException e1) { e1.printStackTrace(); } catch (MessagingException e1) { e1.printStackTrace(); } } else if (failedattempt == 5) { DatabaseManager d = new DatabaseManager("vault_database"); User u = d.retrieveUserFromDatabase(username); d.deleteAllEntriesFromDatabase(u); d.deleteUserFromDatabase(u); try { JOptionPane.showMessageDialog( null, "Your account data has been deleted due to multiple failed login attempts"); VaultController.Send( "sentineldatavault", "SENTINELDATA", username, "Security Warning", "Dear user,\n\nWe have deleted your account.\n" + "Have a nice day.\n\n" + "Sincerely,\nSentinel Data Vault Team"); } catch (AddressException e1) { e1.printStackTrace(); } catch (MessagingException e1) { e1.printStackTrace(); } } } }); frmSignIn.getContentPane().setLayout(null); btnSignUp = new JButton("Create new account"); btnSignUp.setToolTipText("Click here to create a new Sentinel Data Vault account!"); btnSignUp.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { SignupView signup = new SignupView(); signup.setVisible(true); } }); btnSignUp.setBounds(57, 264, 158, 27); frmSignIn.getContentPane().add(btnSignUp); frmSignIn.getContentPane().add(btnNewButton); frmSignIn.getContentPane().add(lblPassword); frmSignIn.getContentPane().add(lblEmail); frmSignIn.getContentPane().add(textField); frmSignIn.getContentPane().add(passwordField); btnForgotPassword = new JButton("I forgot my password"); btnForgotPassword.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { frmSignIn.setVisible(false); PasswordRecoveryView p = new PasswordRecoveryView(frmSignIn); } }); btnForgotPassword.setToolTipText("Click here to reset your account password"); btnForgotPassword.setBounds(227, 264, 170, 27); frmSignIn.getContentPane().add(btnForgotPassword); lblSentinelDataVault = new JLabel("Sentinel Data Vault"); lblSentinelDataVault.setFont(new Font("Dialog", Font.PLAIN, 22)); lblSentinelDataVault.setBounds(119, 33, 206, 27); frmSignIn.getContentPane().add(lblSentinelDataVault); txtWarning = new JTextField(); txtWarning.setForeground(new Color(220, 20, 60)); txtWarning.setBorder(null); txtWarning.setOpaque(false); txtWarning.setFocusable(false); txtWarning.setEditable(false); txtWarning.setFont(new Font("Tahoma", Font.ITALIC, 12)); txtWarning.setBackground(SystemColor.window); txtWarning.setBounds(57, 196, 340, 26); frmSignIn.getContentPane().add(txtWarning); txtWarning.setColumns(10); frmSignIn .getContentPane() .setFocusTraversalPolicy( new FocusTraversalOnArray(new Component[] {textField, passwordField, btnNewButton})); frmSignIn.setFocusTraversalPolicy( new FocusTraversalOnArray(new Component[] {textField, passwordField, btnNewButton})); }