Hi Guys,
I have a problem with JOptionpan. I m using JOption pane for showing messages or even Exceptions etc. But it does not poped up on TOP.
Its always behind parent windows.
I think i need to specifiy JOptionpane to display on TOP of all windows or dialogs. But how should i do? i really dont know. Can any one tell me how it works. I past my code below.
[HTML]
import java.io.Filenam eFilter;
import javax.swing.JFr ame;
import javax.swing.JOp tionPane;
public class MessageBox extends JFrame{
private static final long serialVersionUI D = 1L;
public static void ShowMessage(Str ing message, String title,int MessageType){
JOptionPane.sho wMessageDialog( null, message, title, MessageType);
}
public static String ShowInputDialog (String message, String title,int MessageType){
return JOptionPane.sho wInputDialog(nu ll,message,titl e,MessageType);
}
}
[/HTML]
I worte this class and always use static methods of this class where ever i need to show a message or exception.
What should i do to show it always on TOP.
It would be much easier if some one send working example.
Thanks in advance
Best regard
3 5219 JosAH 11,448
Recognized Expert MVP
You should pass your JOptionPane a parent, not null, if you want it to be in front
of that parent.
kind regards,
Jos
You should pass your JOptionPane a parent, not null, if you want it to be in front
of that parent.
kind regards,
Jos
Thanks man,
But what should be a parent. I searched for an example but i did not find. Can u please write me a little code example.
Thanking u in advance
best regards
JosAH 11,448
Recognized Expert MVP
Thanks man,
But what should be a parent. I searched for an example but i did not find. Can u please write me a little code example.
Thanking u in advance
best regards
You keep on talking about displaying that option pane 'on top'; on top of what?
The parameter I was talking about is the thing on top of which the option pane
should be displayed; iow, the parameter should be a non null JDialog or JFrame.
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: me |
last post by:
I have a Class Library that contains a Form and several helper classes. A
thread gets created that performs processing of data behind the scenes and
the Form never gets displayed (it is for debug puposes only and is not
normally visable to the user.) The Thread function is actually in the Form
class.
Now.. What I am seeing is that when I create an instance of this Class
Library's Form, which starts the worker thread, it seems to hose up...
|
by: nicver |
last post by:
I am fixing a client's Web site and for some reason an ASP class does
not want to use the variables it retrieves when it initialiases.
This is an excerpt of the class and it is enough to show what is not
working correctly:
------
Class clsAd
private pintMyData1
private pintMyData2
private pintMyData3
|
by: vakap |
last post by:
function show() {
var s = '' ;
for (var i = 0; i<arguments.length; s += '\n'+arguments) ;
typeof(window) != 'undefined' ? window.alert(s) : WScript.Echo(s) ;
}
function f(){}
show('delete(f):',delete(f)) ; // false
g = function(){} ;
|
by: Prabhat |
last post by:
Hi All,
The "Session_OnStart" event doesnot fire if the website has .htm file as the
startup document. If I change the extension of the default document from
..htm to .asp then I can see the event fires, But now I cant change the
default page to .asp.
How can I make the Session_OnStart fire in that situation? Please suggest.
Thanks
|
by: Georg Scholz |
last post by:
Hello,
The class "Control" contains a documented Property "ControlType".
So for example, in a form, you can write code like this:
Dim c as control
set c = me.Controls("textbox1")
if c.ControlType = acTextBox then
...
| |
by: me |
last post by:
I have a Class Library that contains a Form and several helper classes. A
thread gets created that performs processing of data behind the scenes and
the Form never gets displayed (it is for debug puposes only and is not
normally visable to the user.) The Thread function is actually in the Form
class.
Now.. What I am seeing is that when I create an instance of this Class
Library's Form, which starts the worker thread, it seems to hose up...
|
by: Daniel |
last post by:
Hey guys
I have an instance of an object say:
List<Object> myList = new List<Object>();
Object myObject = new Object();
myObject.PositionVector = new Vector3(10,10,10);
myList.Add(myObject);
|
by: Mike |
last post by:
Thanks for the reply, I have been trying that, but I keep getting the same
results. The result I get is that the file exits, when it really doesn't.
All my msgbox display twice and I'm not sure why. Here is the code I'm
using. Can you help?
Public Const fnet As String = "\\server1\images"
Public pfile As String = "TEST01.TXT"
Private Sub DoesExist()
If System.IO.File.Exists(fnet & "\" & pfile) Then
|
by: Connectcase |
last post by:
Hi there,
and greetings from the Netherlands.
Trying to switch over from VB to VB.NET and struggling with something
that seemed very simple:
============================
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |