Here is an example
JPanel panel = new JPanel(){
@Override
protected void paintComponent(Graphics g){
// do stuff
}
@Override
public Dimension getPreferredSize(){
// do stuff
}
};
Would this just be a variation of an anonymous inner class, or is it something else entirely?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…