Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4123628
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:38:08+00:00 2026-05-20T23:38:08+00:00

I want to show a form when i click on edit button on the

  • 0

I want to show a form when i click on edit button on the JTable. The form that is displayed should overlap the JTable and should darken the jTable (just like a black background with transparency). How do i do this ? Do i have to add the jPanel to the window during creation of JFrame or shall i create the panel as a separate file and make it visible when the button is clicked. Tell me how to do this ?

EDIT

Something similar to this

enter image description here

EDIT 2

You have used JOption pane and the other suggestion was to use JDialog. But if i use either of those i cant create child window. I just need to call virtual keyboard from the popped up Jdialog window. I cant access the keyboard as the JDialog is holding the focus. How to solve this issue ?

EDIT 3

The current problem is, i am using virtual keyboard for typing the values in the form displayed by using JDialog. Now i cant able to open the virtual Keyboard and make it active. Even if i open it it is behind the JDialog and the focus is still with JDialog. I need to close the JDialog for using the virtual keyboard.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:38:09+00:00Added an answer on May 20, 2026 at 11:38 pm

    I’m a little late in answering as I was creating a test program, but my idea is the same as Andrew’s (sorry Andrew, and 1+ to Andrew):

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class DarkBackground extends JPanel {
       private static final Dimension MAIN_SIZE = new Dimension(800, 500);
       private static final Color DarkColor = new Color(0, 0, 0, 60);
       private JComponent glassPane;
    
       public DarkBackground() {
          JButton showDialogBtn = new JButton("Show Dialog");
          showDialogBtn.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                setGlassPaneVisible(true);
                JOptionPane.showMessageDialog(DarkBackground.this, "Foo");
                setGlassPaneVisible(false);
             }
          });
          add(showDialogBtn);
          setPreferredSize(MAIN_SIZE);
    
       }
    
       public void setGlassPane(JComponent glassPane) {
          JRootPane rootpane = SwingUtilities.getRootPane(this);
          this.glassPane = glassPane; 
    
          rootpane.setGlassPane(glassPane);
       }
    
       public void setGlassPaneVisible(boolean visible) {
          glassPane.setVisible(visible);
       }
    
       private static void createAndShowUI() {
          DarkBackground darkBgrd = new DarkBackground();
          JFrame frame = new JFrame("DarkBackground");
          frame.getContentPane().add(darkBgrd);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
          darkBgrd.setGlassPane(new MyGlassPane(DarkColor));
       }
    
       public static void main(String[] args) {
          java.awt.EventQueue.invokeLater(new Runnable() {
             public void run() {
                createAndShowUI();
             }
          });
       }
    }
    
    class MyGlassPane extends JComponent {
       private Color backgroundColor;
    
       public MyGlassPane(Color backgroundColor) {
          this.backgroundColor = backgroundColor;
       }
    
       @Override
       protected void paintComponent(Graphics g) {
          super.paintComponent(g);
          g.setColor(backgroundColor);
          g.fillRect(0, 0, getWidth(), getHeight());
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For aesthetic reasons, I want to show a form on top of another form,
i want to show the folder contents in my windows form from where user
To create and show a form takes 10 seconds and i want to shorten
i have DataTimePicker control in my form. i want to show only hh:mm how
hii I want show a pop up Dialog box when i click on to
I want to show a chromeless modal window with a close button in the
I want to show a acknowledgement (more precisely a popup) when form is successfully
I have a form in a Windows form application that I want to display
I want to create a custom Joomla registration form and a profile to show
Using jQuery/jQueryUI I want to populate a form using this HTML/JS show below. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.