Questions tagged as 'joptionpane'

2
answers

How to put icon in JOptionPane buttons?

How do I put an icon in the "Continue" and "Cancel" Buttons that appear in the JOptionPane ?? window The case is represented below: public void metodo(){ JPanel panel = new JPanel(); JLabel label = new JLa...
asked by 19.04.2018 / 20:35
1
answer

Why is this method not adding up?

I'm trying to add two numbers by Swing and JOptionPane , but the below error is appearing. Someone to help me how to solve this? Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: JOptionPane: parentComponent d...
asked by 31.01.2017 / 15:09
2
answers

JOptionPane in the foreground

I have an app that uses JOptionPane to show an error message, however I would like JOptionPane to always appear in the foreground. JOptionPane.showMessageDialog(null, "Usuário ou senha incorreto!", "Erro", JOptionPane.ERROR_MESSA...
asked by 01.11.2017 / 19:29
1
answer

How to swap the JOptionPane background with an image?

Can you use this " ImageIcon " as the background for JOptionPane ? Here is the code I tried: public static void main(String args []){ UIManager UI = new UIManager(); ImageIcon icon = new ImageIcon("Imagens/Imagem.jpg"); //D...
asked by 21.04.2017 / 01:23
1
answer

Initial focus on JOptionPane OK button

I have the following JOptionPane : AsyoucanseethefocusisontheCancelTeacherIneedthisfocustocomeoutOK,butIhavenoideahowtodothis.Mycode:JPanelpanel=newJPanel();JLabellabel=newJLabel("Digite a senha para iniciar o auxilio:"); JPassword...
asked by 14.07.2016 / 19:17
1
answer

Error with data display ArrayList

When retrieving data from an arraylist via the "for" command, it displays the following message: Note:Icouldnotidentifywheretheerroris.Whatdoyouguysthinkiswrong?packagelistatelefonica;importjava.util.ArrayList;importjava.util.List;importjava...
asked by 17.04.2017 / 19:02
1
answer

How can I persist data using ArrayList?

I need my ArrayList data structure to be visible in more than one method of my Products class. I'm working as follows: package estoque; import java.awt.Component; import javax.swing.JOptionPane; import javax.swing.JTextField; import java.u...
asked by 09.03.2016 / 18:53
1
answer

How do I exit JOptionPane without closing the Main window?

I'm trying to create a Java program in Calendar, but when I exit the JOptionPane setting the name of the Directory Owner, called by the main window, the entire application is closed. String nome = ""; do{ nome = JOptionPane.showInpu...
asked by 13.09.2018 / 15:49
1
answer

How to get a char data from JOptionPane?

char cadastrar; cadastrar = JOptionPane.showInputDialog("cadastrar: A-aluno P-professor M-medico");     
asked by 23.05.2018 / 22:28
1
answer

Error while in joption pane: loop

I'm having a serious problem with the while in the following algorithm: You have a data set containing the height and gender (male, female) of 50 people. Make an algorithm that computes and writes: 1 - the highest and lowest height of the gro...
asked by 07.12.2017 / 02:33