Skip to content

Tag: swing

Java: Rotating Images

I need to be able to rotate images individually(in java). The only thing I have found so far is g2d.drawImage(image, affinetransform, ImageObserver ). Unfortunately, I need to draw the image at a specific point, and there is no method with an argument that 1.rotates the image separately and 2. allows me to se…

Java Swing JtextField inset

I am working with Netbeans GUI and I would like to add 3 pixels of space at the beginning of my jTextField : I have tryied with setMargin, setInset in the GUI but it doesn’t change anything. I have another question, why the bottom right border is not rounded ? here is my code : thank you very much, Rega…

How to generate exceptions from RepaintManager

In connection with my question (may be), I found another exception type that I not able to catch and print-out from SwingWorker thread. How can I to generate RepaintManager exceptions? I read this CheckThreadViolationRepaintManager and this approach by Alexander Potochkin, but nothing seems to solve my issues…

Why jframe hides taskbar when maximized?

I’m using setUndecorated(true); and getRootPane().setWindowDecorationStyle(JRootPane.FRAME); in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar? Also when I maximize minimize my fram…

How do I remap the NumLock key in Java Swing?

You may have read my earlier question about remapping my keyboard at a low level in Java and I did find a solution – mostly. To be honest, I oversimplified the problem I was trying to solve. I not only want to match NumericKeypad 1-3 to 7-9 and vice versa, I want to remap the whole numeric keypad. In pa…

Remove row being edited from JTable

I have a JTable and a button next to it that calls deleteSelectedRows(), which does exactly what it sounds like: But if a cell was in the act of being edited when it (and/or cells above it) were deleted, the edited cell stayed while the rest left, like this: And then trying to exit out of the editing threw an