In a JSplitPane, you have the setOneTouchExpandable method which provides you with 2 buttons to quickly fully hide or full show the JSplitPane. My question is how can you programmatically “click” the hide button on the JSplitPane? I may have wrongly explained myself. I want the splitpane to show only one of the 2 components at start (this is what
Tag: swing
How to change background color of JOptionPane?
I have added JOptionPane to my application but I do not know how to change background color to white? Answer By using the UIManager class or
How do I move my JMenuBar to the screen menu bar on Mac OS X?
When I move my JMenuBar to the screen menu bar on Mac OS X, it leaves some blank space where the menu would be in my window; I need to remove that space. I am using to move my JMenuBar to the screen menu bar. My friend who uses a Mac reports that this leaves some ugly vertical space where
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 set the x and y. any help is
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, Regards
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. Answer If it helps, the example below throws prints multiple variations of the
How can I find out which button was clicked?
I’ve got my buttons working right, and I’m a listener to each button like this: Here as you can see the listener is called, and I want to find out which button I’m clicking. Is there a way to do that? I need some way to find the button in the array. Answer try this
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 frame multiple times the cursor is changed to this <-> which is generally used
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 particular,
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