扩展JPanel类的程序不访问方法plotComponent()
JFrame
package client.connection;import java.awt.Dimension;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import javax.swing.JFrame;class DrawFrameRemoteControl extends JFrame{ private DrawPanelRemoteControl imagePanel; private ClientRemoteControlConnection clientRemoteControlConnection; private ObjectInputStream clientInputStream; private ObjectOutputStream clientOutputStream; private Dimension imageDimension; private Dimension serverDimension; public DrawFrameRemoteControl(Dimension imageDimension,ClientRemoteControlConnection clientRemoteControlConnection,ObjectInputStream clientInputStream,ObjectOutputStream clientOutputStream,Dimension serverDimension) { super("Remote Desktop Control"); this.clientRemoteControlConnection=clientRemoteControlConnection; this.clientInputStream=clientInputStream; this.clientOutputStream=clientOutputStream; this.imageDimension=imageDimension; this.serverDimension=serverDimension; imagePanel=new DrawPanelRemoteControl(imageDimension); add(imagePanel); setSize(imageDimension.width,imageDimension.height); setResizable(false); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); setLocationRelativeTo(null); } void drawNewImageGrayscale(byte[] array) { imagePanel.setNewImageGrayscale(array); imagePanel.repaint(); }}
imagePanel.repaint()
paintComponent()
DrawPanelRemoteControl
imageDimension
补充资料:main()
DrawFrameRemoteControl
drawNewImageGrayscale(byte[] arr)
main()
相关分类