473,608 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to coustomise JOptionPane

35 New Member
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 necessary coz............ in my game i cant afford having a JOptionPane tht looks sad .........I want to be catchy !!!


kind regards,
Malavika
Oct 22 '07 #1
5 4532
r035198x
13,262 MVP
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 necessary coz............ in my game i cant afford having a JOptionPane tht looks sad .........I want to be catchy !!!


kind regards,
Malavika
Apart from JOptionPanes you can also use JFrames and JDialogs ...
Oct 22 '07 #2
Ramola
35 New Member
Apart from JOptionPanes you can also use JFrames and JDialogs ...
so does tht mean " I cant customize JOptionPanes ".......... ...

kind regards ,
Malavika
Oct 22 '07 #3
r035198x
13,262 MVP
so does tht mean " I cant customize JOptionPanes ".......... ...

kind regards ,
Malavika
Read the API specs for it to see how much you can do with them.
Oct 22 '07 #4
Ramola
35 New Member
Read the API specs for it to see how much you can do with them.
thanks alot !
will let u know the development ! :)

Apart from tht ( r035198x ) i was wondering if u could plz.....plz.. look into another thread called ' jmf ' .......

Its a very stupid thing tht i might be missing in ' jmf ' ............if u colud plz pointit out to me !

kind regards,
Malavika
Oct 22 '07 #5
dipti000
1 New Member
can use
UIManager.put(" OptionPane.back ground",Color.R ED);
Aug 23 '13 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
12847
by: - Steve - | last post by:
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).
1
4843
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 am able to prompt for typing the information but the display does not work. Here is my sample code: **
2
3044
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 confused by Sun's site and I keep getting error messages. Below is what I have and the error message when I try to compile. Any help would be much appreciated. Thanks! package javaapplication1; /** * * @author Jillian */ public class...
2
3343
by: ragaman123 | last post by:
Hello there, I am designing a battleships game in java and am trying to output to the screen a simple message when a user sinks a ship. I have been trying to use JOptionPane to output a message, however it is not working correctly. The message is not being painted to the screen properly and the whole screen becomes inactive and i cant press any of the buttons on it. Any suggestions would be greatly appreciated?? Cheers, Ragaman
2
2025
by: majorecono | last post by:
I took a look at the site and found this as a counter. Is there any way I can use it in a dialog box, that asks user to input any number of letters in a (?)dialog box, pressing enter and out comes Number of upper/lower case e's in the (I)dialog box. Also have it repeat process until user enters Stop. Well yeah, thanks if anyone can help put that up tonight.. String str = "Count" ; char ch = 'e'; char ch2 = 'E'; int count = 0 ;
3
5051
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 sentence, using JOptionPane.showInputDialog(). 2. The program will scan each letter in the string and count how many times the upper case letter 'E' appears, and how many times the lower case letter 'e' appears. 3. Using a JOptionPane.showInputDialog(),...
1
2121
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;
1
1262
by: kamhal | last post by:
is there a way to use this function or any similar function in j#? i have been trying to figure out how to pop a message box in j#. can u help pls?
3
7448
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 JDialog is not working. The code is running and not giving errors but when it comes to printing the statements, when I press enter , nothing is happening . Can anyone help on this one? JOptionPane pane=new...
0
8050
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7987
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8130
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8324
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6000
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3954
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4015
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2464
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.