problem about paint-Collection of common programming errors


  • pearmak
    android paint bitmaps
    I am now making a painting apps, and would like to ask how to load a picture and set to a Bitmap?I have set the coding as follows, and links Class A and Class DrawView.Question:The code reports error “The method setImageBitmap(Bitmap) is undefined for the type Bitmap” in DrawView Class for the linebitmap.setImageBitmap(BitmapFactory.decodeFile(picturePath));, I do not know how to load a picture to Bitmap. in Class A:private DrawView drawView; … …public void go_load_pic() { Intent i =

  • mKorbel
    java swing paint repaint jcomponent
    I am new on java. I want to create an abstract factory in java. I have a class point and I want to extend other classes ( circle, rectangle ) from this. Here is my code. It says repaint is undefined..import javax.swing.*; import java.awt.*; import java.awt.Component; import javax.swing.*;public class Circle extends Point {public void Draw() {repaint(); }public void paint(Graphics g) { g.drawOval(this.x, this.y, 10, 10);}…

  • mKorbel
    java swing stackoverflow paint
    Alright so I am making a calculater, and I am getting a stack overflow error, i’m guessing because it’s trying to handle to much data.import java.awt.*; import javax.swing.*; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;public class Size extends JPanel implements ActionListener {double base,size; int shoesize; String race;JButton calc = new JButton(“Calculate”);JTextField textsize = new JTextField(20);public Size() {

  • Andrew Thompson
    java swing nullpointerexception paint
    This is the error that i get occasionally but it halts the working of the UIDoes anyone know how to solve it?This error hangs the UI generally occurs when we do repaint or update UI.Exception in thread “AWT-EventQueue-0” java.lang.NullPointerExceptionat javax.swing.plaf.synth.SynthLookAndFeel.paintRegion(Unknown Source)at javax.swing.plaf.synth.SynthLookAndFeel.update(Unknown Source)at javax.swing.plaf.synth.SynthPanelUI.update(Unknown Source)at javax.swing.JComponent.paintComponent(Unknown Sour

Originally posted 2013-11-26 15:40:31.