java - Changing of JDialogs modality to block only one JFrame -
I have a piece of code:
Public Waiting (Window Main Window , String string, JFrame stFrame) {interface = new JDIOL (strframe); // dialog.setForeground (new color (100, 100, 100)); Dialog.setUndecorated (true); Dialog.setSize (WAITING_DIALOG_WIDTH, WAITING_DIALOG_HEIGHT); Int x = mainWindow.getX () + (mainWindow.getWidth () - dialog.getWidth ()) / 2; Int y = mainWindow.getY () + (mainWindow.getHyight () - dialog.getHeight ()) / 2; Progress bar .Set offground (new color (0, 128, 0)); ProgressBar.setString ("Loading data ..."); Font font = new font ("serif", font.b.a., 12); ProgressBar.setFont (font); ProgressBar.setStringPainted (true); ProgressBar.setIndeterminate (true); Add dialog.getContentPane () (Progressbar). Dialog.setLocation (x, y); Dialog.setModal (true); } My problem is that, when dialog appears, it blocks all the applications and it is a JFrame StFrame (which is actually a tab ), I want to remove only that tab ( stFrame ) Update: The code where I focused on the tab:
maingui GetContentPane () (MainTabs); // Manguai is a Jeffrey main tabs. AddTab ("Editor", Editor Panel); Statistics stat; // St JFrame MainTab AddTab ("Statistics", blank, st.getContentPane (), zero) increases; Modal works only for windows, so you can not use it to block tabs. You overhaul the system (and it is a non-trivial one). One option is to call setEnabled (false) in tabs and components in its view - the pane of content depends on the frame implementation in your case if you If you do something in a tab, it pops when it pops in your tab or in some other way. You call setEnabled in the override of setvisible - which should give you the desired result (this is not the place where the rules are called, so treat it in a slightly different way Some circumstances may happen). Another option is to add some mouse listener manually to the tab and block it or block its component-in-view. It is more messy but how works more effectively.
As a means of communication, it depends if you want to block it to its original frame - whose content is displayed in the panel tab, note that there is no connection between tab and frame The way you present it.
Comments
Post a Comment