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 126969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:24:08+00:00 2026-05-11T05:24:08+00:00

Edit: The question follows the horizontal rule; my own answer precedes it. Based on

  • 0

Edit:

The question follows the horizontal rule; my own answer precedes it.

Based on help from Oscar Reyes, I crafted this solution:

import javax.swing.JOptionPane; import javax.swing.JFrame;  public class MyApp extends JFrame {     public static void main(String [] args) {         new MyApp();     }      public MyApp() {         super('MyApp');         setUndecorated(true);         setVisible(true);         setLocationRelativeTo(null);         String i = JOptionPane.showInputDialog(this, 'Enter your name:', getTitle(), JOptionPane.QUESTION_MESSAGE);         if(null != i) {             JOptionPane.showInputDialog(this, 'Your name is:', getTitle(), JOptionPane.INFORMATION_MESSAGE, null, null, i.concat(i));         }         dispose();     } } 

Notice I display my output in a JOptionPane.showInputDialog also. This way the output is highlighted in a text field so I can simply press CTRL+C to copy the output to the system clipboard and them press ESC to dismiss the application.


I’ve created a trivial GUI for my trivial application. My application prompts for a single input with a JOptionPane.showInputDialog, performs a calculation, and then displays a single output with a JOptionPane.showMessageDialog. I sometimes switch to a maximized browser window or something else to copy from, and then want to switch back to my JOptionPane dialog to paste into.

I want to have my JOptionPane dialog show up as a task on the taskbar so I could switch to it like nearly any other running program. I prefer JOptionPane’s simplicity, rather than having to create a JFrame, a FlowLayout, an Icon, a JTextField, a JButton, an ActionListener, and so on, and so on.

  • Can JOptionPane show up as a task on the taskbar?
  • If so, how do I get it to show up?
  • If not, is there anything else that’s a one-liner like JOptionPane.show[whatever]dialog()?
  • 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. 2026-05-11T05:24:08+00:00Added an answer on May 11, 2026 at 5:24 am
    • Can JOptionPane show up as a task on the taskbar?

    No

    • If not, is there anything else that’s a one-liner like JOptionPane.show[whatever]dialog()?

    Not exactly one liner ( but some extra 6 lines 😛 )

    I bet you cam put all this in a utlity method pretty easy and call it whenever you need it with a single call.

    The following code would add a taskbar for your app.

    import javax.swing.JFrame; import javax.swing.JOptionPane;  public class OptionTest {      public static void main ( String [] args ) {           JFrame frame = new JFrame('My dialog asks....');          frame.setUndecorated( true );         frame.setVisible( true );         frame.setLocationRelativeTo( null );           String message = JOptionPane.showInputDialog(frame,             'Would this be enough?.',              'My dialog asks....',              JOptionPane.INFORMATION_MESSAGE);          System.out.println( 'Got ' + message );          frame.dispose();     } } 

    By the way in Windows Vista, I can switch to the OptionPane using Alt+Tab without anything else ( although I cannot see it in the taskbar as you said )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question follows on from the problem posted here when i run explain I
this kind of follows on from another question of mine. Basically, once I have
This follows on from this question This was working: <body onbeforeunload= ajaxRequest('UnlockQuery.ashx?QueryID=266&UserID=11631');> This was
This follows on from this question: Algorithm to generate spanning set Given this input:
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This question is more about language engineering than C++ itself. I used C++
EDIT : This question duplicates How to access the current Subversion build number? (Thanks
(EDIT: This question is now outdated for my particular issue, as Google Code supports
Edit This question has gone through a few iterations by now, so feel free
EDIT: This question is a duplicate of What is the difference between managed and

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.