Unable to run Java GUI programs with Ubuntu

前端 未结 9 753
天命终不由人
天命终不由人 2020-12-03 04:28

I am learning GUI in Java, and for that I have created a demo program:

import java.awt.*;

public class FrameDemo extends Frame {

    public FrameDemo(){
           


        
9条回答
  •  既然无缘
    2020-12-03 05:17

    Use JFrame instead of Frame. And do not extend from JFrame. Just write a class that has a JFrame property named gui, which configures this JFrame with the available methods, because it is better style doing it like this. Extending here is wrong the use of OOP.

提交回复
热议问题