473,385 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why Joptionpan does not show on TOP

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.FilenameFilter;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class MessageBox extends JFrame{

private static final long serialVersionUID = 1L;


public static void ShowMessage(String message, String title,int MessageType){

JOptionPane.showMessageDialog(null, message, title, MessageType);

}

public static String ShowInputDialog(String message, String title,int MessageType){


return JOptionPane.showInputDialog(null,message,title,Mes sageType);
}


}
[/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
Oct 1 '07 #1
3 5203
JosAH
11,448 Expert 8TB
You should pass your JOptionPane a parent, not null, if you want it to be in front
of that parent.

kind regards,

Jos
Oct 1 '07 #2
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
Oct 2 '07 #3
JosAH
11,448 Expert 8TB
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
Oct 2 '07 #4

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

Similar topics

5
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...
3
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...
2
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(){}...
31
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...
1
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...
0
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...
18
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); ...
3
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...
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
Oralloy
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,...
0
jinu1996
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 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.