Example
String testString = "Testing \t tabs";
JOptionPane.showMessageDialog(null, testString, "TEST",
JOptionPane.INFORMATION_MESSAGE);
Instead of getting the output "Testing tabs", I get something more like
"Testing | tabs" (although it isn't a pipe symbol, it's something unusual).
What do you need to do to get tabs to work with JOptionPane windows? 3 12831
I think you have to use a JLabel or JTextField to do this:
JOptionPane.showMessageDialog(null, new JLabel(testString), "TEST",
JOptionPane.INFORMATION_MESSAGE);
"- Steve -" <se****@foundation.sdsu.edu> wrote in message
news:1yGmb.29102$B_2.26152@okepread02... Example
String testString = "Testing \t tabs";
JOptionPane.showMessageDialog(null, testString, "TEST", JOptionPane.INFORMATION_MESSAGE);
Instead of getting the output "Testing tabs", I get something more like "Testing | tabs" (although it isn't a pipe symbol, it's something
unusual). What do you need to do to get tabs to work with JOptionPane windows?
Unfortantley that doesn't change the tab behavior and eliminated the
functionality of the \n (everything is now on one line)
Steve
"SPG" <st************@nopoo.blueyonder.co.uk> wrote in message
news:bN*********************@news-text.cableinet.net... I think you have to use a JLabel or JTextField to do this:
JOptionPane.showMessageDialog(null, new JLabel(testString), "TEST", JOptionPane.INFORMATION_MESSAGE);
"- Steve -" <se****@foundation.sdsu.edu> wrote in message news:1yGmb.29102$B_2.26152@okepread02... Example
String testString = "Testing \t tabs";
JOptionPane.showMessageDialog(null, testString, "TEST", JOptionPane.INFORMATION_MESSAGE);
Instead of getting the output "Testing tabs", I get something more
like "Testing | tabs" (although it isn't a pipe symbol, it's something unusual). What do you need to do to get tabs to work with JOptionPane windows?
OK,
Try passing the text as HTML. IE Wrapping some tags around it. That worked
for us by accident when we were reporting errors from an HTTP post once.
If not, then use a JTextField or JTextArea, setting no border and the
bgcolor the same as the dialog, and editable = false. These can handle tabs
for sure!
Steve
"- Steve -" <se****@foundation.sdsu.edu> wrote in message
news:T22nb.36399$B_2.25477@okepread02... Unfortantley that doesn't change the tab behavior and eliminated the functionality of the \n (everything is now on one line)
Steve
"SPG" <st************@nopoo.blueyonder.co.uk> wrote in message news:bN*********************@news-text.cableinet.net... I think you have to use a JLabel or JTextField to do this:
JOptionPane.showMessageDialog(null, new JLabel(testString), "TEST", JOptionPane.INFORMATION_MESSAGE);
"- Steve -" <se****@foundation.sdsu.edu> wrote in message news:1yGmb.29102$B_2.26152@okepread02... Example
String testString = "Testing \t tabs";
JOptionPane.showMessageDialog(null, testString, "TEST", JOptionPane.INFORMATION_MESSAGE);
Instead of getting the output "Testing tabs", I get something more like "Testing | tabs" (although it isn't a pipe symbol, it's something unusual). What do you need to do to get tabs to work with JOptionPane windows?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: jazzy |
last post by:
Hi,
I am new to Java Programming and I am trying to write code using JOption
pane to prompt user to type information and then have string output command
to display information on the screen.
I...
|
by: tnhoe |
last post by:
Hi,
I would like to set focus to a field in a form inside a tab page.
It is a multiple tabs under different divisions (eg: sc1,sc2,sc3,etc)
<div name='sc1'>
<form name='form1'>
<input...
|
by: jek339 |
last post by:
Hey, I'm totally new to Java, and I'm taking a class. My current assignment involves inputting 2 names and corresponding bdays for each name using the JOptionPane.showInputDialog etc. Anyway, I'm...
|
by: Stephen Edwards |
last post by:
I am a novice, so bear with me.
I designed a website using CSS TABS, all was fine, then I copy and pasted meta name, etc for keywords, tweaking it where necessary for keywords. I did not notice...
|
by: majorecono |
last post by:
What I'm bad at is the dialog box part. This is the code Ive come up with... if you see a way to improve what im thinkng of.... post it please.
Program should....
1. Ask user to type in a...
| |
by: Smarteric |
last post by:
import javax.swing.JOptionPane;
public class MilesPerGallon
{
public static void main(String args)
{
String miles;
String gallons;
double MPG;
double miles1, gallons1;
|
by: Ramola |
last post by:
hi,
I was wondering if i can customise a JOptionPane ???
ex : A JOptionPane by default has a background color gray............. can i change it ?? can i put some images in the background ?
Its...
|
by: heat84 |
last post by:
I want to customise JOptionPane and add a KeyListener to it. I want to behave in a certain manner when the enter key is pressed , but from the look of things, the key listener I am adding to the...
|
by: Andrew Poulos |
last post by:
Is there a way for javascript to know if a browser has been set to open
new windows in tabs? I'm trying to fix some code that allows a user to
close a window that javascript opened and it seems to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |