Java drawing opaque rectangle on transparent JFrame
I am trying to draw an opaque rectangle on a transparent JFrame to implement a “screen capture” type of program, but I’m having a few difficulties. The first difficulty is that the rectangle is only drawn when I’m moving the mouse while dragging but it goes away when I don’t move my mouse. The second difficulty I’m having is I’m not quite sure how to make the rectangle a different opacity than the frame. Here is the code I have so far
How to change the Icon of a JLabel dynamically?
I’m using the Swing library and the ApacheNetBeans IDE for a project at my school. The following code is for a method that needs to simulate a dice roll; I want a JLabel (which represents the dice) to have its Icon changed sequentially, a few times. Each Icon is one side of a piece of dice.
Why does setPreferredSize not work in my code?
While trying to create a panel for my game, I am trying to use a number of things such as setPreferredSize, setBackground, and more, but for some reason all of these are being underlined. Also, I’m following this video: https://www.youtube.com/watch?v=om59cwR7psI&t=702s and I have been following the steps very closely so I’m not sure why it isn’t working for me.
How can I get the value of a boolean checkbox column in my JTable?
I want to add data from a table row to an array depending on their checkbox value in the boolean column of that row.
How can I get the value of a boolean checkbox column in my JTable?
I want to add data from a table row to an array depending on their checkbox value in the boolean column of that row.
Triggering parent’s size recalculation after child hiding
I wrote a custom JComboBox
that display a search text field once the number of items becomes big enough to necessitate a scroll bar
Gap between menu items in Swing
I have a ComboPopup
implementation, it’s a JPopupMenu
wrapper. It has two stacked elements, the upper of which, a JTextField
, is optional
I can’t change the value of downcasted object
i am trying change the value of objet by downcast it but original object value doesnt change. I didn’t find any solution on internet. Thanks for all help
java: package com.sun.java.swing.plaf.windows does not exist
Switched from JDK 8 to JDK 17. The code now doesn’t compile
Searchable JComboBox with custom items
I need to implement a “searchable” JComboBox
: one that filters its displayed items as you type