Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Applet / Dialog Box Cut Off

Status
Not open for further replies.

bettyc

Technical User
Mar 6, 2009
8
US
I am attempting to convert a Java application to an Applet. I have dialog boxes (via JOptionPane.showInputDialog) that get input from the user. The dialog boxes look fine in the Java app, but in the Applet they get cut off (i.e. the OK and CANCEL buttons are partly chopped and also some of my prompting text is cut off).

Is there a way to change the size of the dialog or another why to get user input? My goal is to get numbers from a user in a sentinel controlled loop and then return the sum.

Thanks,
Betty ::)
(new to Java)
 
Increase the size of the Applet in your HTML page, if you are using the applet tag is goes like this:
Code:
<applet code=&quot;MyApplet.class&quot; width=100 height=140></applet>
Increase the width or height or both until the applet is big enough for your purposes.
 
wushutwist,

I tried changing the size of the Applet window before I posted my question (sorry I didn't think to include it), but it does not resolve the problem. I didn't word my question very well either. Let me elaborate.

The Input dialog box itself is not cut off, and the size does not change when I change the size of the Applet window. The OK and CANCEL buttons are cut off because the Input dialog box is not tall enough. Also, it is not wide enough for the text I add to prompt the user.

For example:

The box should show -
&quot;Please enter an integer for Client ID, -1 to Quit&quot;

Actually shows -
&quot;Please enter an integer for Client ID, -1 to Q...&quot;

Is there a way to make it &quot;stretch&quot; to fit my prompting text?

Thanks,
Betty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top