11 Topics

Member Avatar for
Member Avatar for Start4me

I'm trying to show a user JOptionPane where they enter x and y coordinates each in their own textfield, but I don't know how to store user input as ints. So I need to do something like: int xCorFromUser = xCor; int yCorFromUser = yCor; I have this code so …

Member Avatar for mKorbel
0
1K
Member Avatar for Gl753

Sorry for the misleading question guys, I know how to generate two random numbers but I want to use them in One JOptionPane input Dialogbox so the user can add the two numbers. Below is my code of what I have done so far I know it's not a lot …

Member Avatar for Gl753
0
453
Member Avatar for Lamirp

Ok I'm just looking for a cleaner way to achieve my goal here, if there is one and if this is not much of a satisfactory method. The goal is to accept an integer from a user using JOptionPane.showInputDialog. A brief example of what I'm currently doing do { check …

Member Avatar for mKorbel
0
6K
Member Avatar for mukiibi

This code can help you to find the square root of three numbers accepting the inputs from the user and displaying the results in a Joption pane. let me hope it will help import javax.swing.JOptionPane; import java.text.DecimalFormat; public class Squareroot { public static void main(String[] args) { String stringNum1,stringNum2,stringNum3; double …

0
95
Member Avatar for poojavb

Hello All, I have a Java program which is using a JOptionPane in it. eg. Are you sure u want to close the application? Yes No When I click with the mouse on the No button it works correctly but if I select the No button using the TAB key …

Member Avatar for poojavb
0
405
Member Avatar for iEpic

The code i used in JGrasp to show the image is not working in Netbeans The code i used in JGrasp is final ImageIcon icon1 = new ImageIcon("image/money.gif"); JOptionPane.showMessageDialog(null, " blah blah", "Text", + JOptionPane.INFORMATION_MESSAGE, icon1); And if i wanted to show an image in JOptionPane.showInputDialog would it be the …

Member Avatar for NormR1
0
4K
Member Avatar for DanCuster

Hello everyone, I am building a tic-tac-toe game for my final and everything is going smoothly except for one problem. The names I ask the user to enter at the beginning of the game, a replaced with null when the messagebox that shows who won appears. Here is the code, …

Member Avatar for JamesCherrill
0
637
Member Avatar for AMeddaugh

My Java teacher hasn't been very clear, and i'm kind of flying solo here. He gave us this project, and one part of the project is throwing up a JOptionPane which allows the user to input a number which correlates to a specific car. For example [QUOTE]Choose a vehicle that …

Member Avatar for AMeddaugh
0
146
Member Avatar for akingcool

I am trying to design a file reader with some sort of GUI so I decided to use JOptionPane. I am a complete noob trying to learn java. So far, I have managed to make my program produce a pop up for the file location, and also an error message …

Member Avatar for mKorbel
0
3K
Member Avatar for hfx642

[B][I]This it only for people who are running a DUAL Monitor system.[/I][/B] I wrote a sample program to display what occurs. No matter which button I click on (Primary Display OR Secondary Display), the JOptionPane will pop up on the Primary Display. What I would like to happen is... If …

Member Avatar for hfx642
0
937
Member Avatar for yancouto

EDIT: My problem was solved. :) But I have a doubt, what is the most effective way to wait for something to happen in java? for example, if I want to wait for a boolean b to be true, does this below work? [CODE=java]while(!b) {} //stuff to do after wait …

Member Avatar for yancouto
0
127

The End.