paintcomponent
Java - Change BufferedImage File
I have a Java class that extends JPanel and implements MouseListener, and trying to duplicate some basic functionality of JButton but with some loaded images to make things more pretty. Here\'s some s[详细]
2023-02-14 13:40 分类:问答Why is nothing painted when I call repaint()?
First of all, I am a beginner. I\'m trying to make a puzzle game using an array of Pieces. Each Piece represents a number from 1 to 9. I am trying to paint using paintComponent(Graphics g), but when I[详细]
2023-02-09 01:02 分类:问答Why does setting the layout to BorderLayout mean the paintComponent is never called
In the following example program, if you set useBorderlayout to true, the paintComponent method is never called - why?![详细]
2023-02-07 17:27 分类:问答How to display a BufferedImage in JApplet
No images are displayed on the japplet. public void setCharacter(String type) { try { character = ImageIO.read(new File(type));[详细]
2023-02-06 02:50 分类:问答paint on a container being added to jcomponent
i have a jrame on which i add some JComponent objects. Each JComponent has a list of containers i add by using JComponent.add( Component).[详细]
2023-02-03 13:45 分类:问答java 2D and swing
I have trouble understanding a fundamental concept in Java 2D. To give a specific example: One can customize a swing component via implementing it\'s own version of the method paintComponent(Graphics[详细]
2023-02-01 21:08 分类:问答paintComponent() leaving behind previously drawn images after repaint()
I have a JPanel which draws .png images. each image has 2 copies to signify whether or not it has been selected. One image is normal and one has a colored border to signify the selection has been made[详细]
2023-01-23 10:55 分类:问答drawing a graph in a JPanel in Net Beans
Is there a possible way to override the paintComponent() method in the auto-generated GUI code in NetBeans?[详细]
2023-01-08 08:33 分类:问答Non-Working paintComponent method
Code : import javax.swing.*; import java.awt.*; public class firstGUI extends JPanel { public static void main(String[] args) {[详细]
2023-01-06 22:21 分类:问答JPanel: both implementing my own paintComponent() and rendering children doesn't work
I\'m extending a JPanel to display a game board, and adding a JEditorPane at the bottom to hold some status text.Unfortunately, the game board renders just fine, but the JEditorPane is just a blank gr[详细]
2022-12-29 09:26 分类:问答