I looked everywhere to see with anyone had the same problem than me but it seems I’m the only one getting this error. So I’m in Java with Swing. I have a class Player that draws an image of the player. However, each time I tried to use setTransform to rotate my image, the second instance of player is scaled
Tag: swing
Text editor: if certain key pressed want to cancel key event and give new functionality
I have a JEditorPane with text/html type. When an enter key is pressed with the editor focused, I want to do some checks about the state of the document and then override the enter key default functionality if conditions are met. I believe this can be done with a KeyListener listening for a key, then consume the event if conditions
Close window after checking
I’m having a slight issue, and I can’t figure it out. I want for my code to check if the email and password matches and then close the window. This the action: Answer I am going to assume you have an issue with opening a new frame and disposing of the login frame, because if you have an issue with
Keeping a JScrollPane’s (JTextPane) scroll bar at the bottom when resizing text?
Very weird problem: I have a JTextPane within a JScrollPane, and a JSlider for resizing the text. If I increase the text size, the scroll bar moves up (normal). My goal is to keep the scroll bar at the bottom, if it was at the bottom before resizing the text. The weird thing is, I can ONLY get it to
Java Swing BoxLayout layout of outer panel changes when I specify layout of inner panel
I’m very new to Java Swing. I’m using y-axis BoxLayout on an “outer” panel that contains 2 inner panels. Here you can see with this basic code, the 2 inner panels get an equal share of the height avaiable in the box layout (first inner panel yellow, second innner panel orange) But then when I add seperate layout manager to
Misaligned box in box layout when adding JScrollpane
I wanted to create a simple table with the some of the features of a JTable, but easier to style, so I created a couple of boxes in a box layout, one for the header and another to contain the cells. When I added the JScrollPane to the cell’s box, it indented the header box and now the don’t line
How to use a JLabel as a JButton?
I am trying to make a program that uses a JButton, but the regular button isn’t working, so I want to make it so that when I press the JLabel it will activate a function. Answer All that you have to do is this:
Problems removing and replacing components from JScrollPane [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question I am having problems changing JScrollPane components. I have an ArrayList named textFields
JTextField doesn’t appear after switching panel using CardLayout
i have 4 panels associated to a content panel which uses a card layout. If i try to switch between the cards by using the buttons, i can see the JLabels but no JTextFields. I assume they are there because there is space between the JLabels, so i tried to revalidate and repaint the panels after switching to them but
Adding JavaFX PieChart in JPanel
I want to add a Pie chart inside a JPanel. I have gone through this and this. But it didnt helped me. I tried this code in the debugger but it is not getting pass line X. Somehow setScene function is not working and pie chart is not visible in the panel. Here’s my code: I am not sure why