Questions tagged [jpopup]

33 questions
7
votes
2 answers

Adding a vertical separator in PopupMenu, in the task bar

How can I add a vertical separator in the pop up menu of the app in the task bar ? tray = SystemTray.getSystemTray(); openMenuItem = new MenuItem("Open P"); stopKLMenuItem = new MenuItem("Stop"); exitMenuItem = new…
Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
6
votes
4 answers

How can i make a JPopupMenu transparent?

I'd like to customize the look of JPopupMenu so i made a custom class extending the JPopupMenu class on i overrode the paintComponent method as i would do for any component i need to customize. public class CustomPopupMenu extends JPopupMenu { …
nathan
  • 1,111
  • 3
  • 18
  • 33
6
votes
6 answers

How can I make combobox's list wider?

import javax.swing.*; public class test { public static void main(String[] args) throws Exception { JFrame frame = new JFrame("Test"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); …
Ichibann
  • 4,371
  • 9
  • 32
  • 39
4
votes
2 answers

Popup for JFrame close button

i am doing some basic Java Swing application (beginner level) . what i have to do is when i press close button on JFrame to colse the window i want a JOptionPane Confirm Dialog instead of straightforward close here is the code …
Sikander
  • 2,799
  • 12
  • 48
  • 100
4
votes
1 answer

Copy cell value of JTable with right click

I am showing some results in a JTable that consists of 2 columns. File - Result I implemented a JPopupMenu which displays a copy entry, and I try to copy the value of the cell, where I right-clicked. filelistTable.addMouseListener(new MouseAdapter()…
Stefan
  • 2,603
  • 2
  • 33
  • 62
3
votes
2 answers

Java popup menu listen for item clicks?

Im creating a very simple tray menu with the following code: final Frame frame = new Frame(""); frame.setUndecorated(true); // Check the SystemTray is supported if (!SystemTray.isSupported()) { …
Alosyius
  • 8,771
  • 26
  • 76
  • 120
3
votes
5 answers

Swing persistent popup

I need to display a swing popup with my custom component. The popup should stay visible, until I hide it myself, but shouldn't get focus. I have a code written by some other developer that does it in the following way: popupMenu = new…
Ilya Ivanov
  • 2,379
  • 1
  • 21
  • 24
3
votes
1 answer

How to Listen for JCombobox Selection Event

When I select the JCombobox I want to handle an event when its selected and the dropdown is shown as well as handle the event when the drop down disappears and the JCombobox is de-selected. Note, i'm not looking to listen for an item selection…
Sammy Guergachi
  • 1,986
  • 4
  • 26
  • 52
2
votes
1 answer

How do I make my Swing JComboBox expand horizontally instead of vertically?

I am working with Swing and am adding a JComboBox to a JPanel. Normally, when you click a JComboBox it enumerates the possible options vertically (similar to combo boxes on any website). However, I would like for the ComboBox to expand horizontally…
sdasdadas
  • 23,917
  • 20
  • 63
  • 148
2
votes
1 answer

JComboBox displaying invisible drop-down menu

This is my first question on stackoverflow and I'm in need of some help. As part of a grander java application, I would like to bring up a JDialog with a couple of JComboBoxes querying the user to select a printer to use and then select the…
CB_Maverick
  • 227
  • 1
  • 7
2
votes
2 answers

Handle JPopupMenu closed

I want to highlight some elements on screen, when one JMenuItem in PopupMenu ist selected(mouse over). So i use MouseListener on my JMenuItem with @Override public void mouseEntered(MouseEvent e) { highlightOn(); …
AvrDragon
  • 7,139
  • 4
  • 27
  • 42
2
votes
1 answer

Open JPopupMenu from opened JComboBox

I'd like to change OOTB behaviour of combobox, to freeze it after right mouse button click (detecting which button was clicked is easy, so that's not the point) and open JPopupMenu istead of choosing that entry. So - how to disable choosing entry on…
dantuch
  • 9,123
  • 6
  • 45
  • 68
1
vote
1 answer

JPopupMenu is not displayed on right click

import java.awt.FlowLayout; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JFrame; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; public class B extends MouseAdapter { JFrame frame = new…
Raees Khan
  • 371
  • 1
  • 5
  • 20
1
vote
2 answers

JCheckBoxes inside JComboBox

I have added checkboxes inside combo box in Java. But when I open drop down menu and check one check box, the drop down menu closes. So to select each check box I have to open it every time. Is there any way so that I can keep the drop down list…
1
vote
2 answers

Opening JXDatePicker on gaining focus

I am trying to extend JXDatePicker so that it opens up when it gains focus. Have searched for suggest that I understand without success. Is there an elegant way of doing this?
Tony Wolff
  • 732
  • 1
  • 10
  • 23
1
2 3