求助1段java的编写

来源:百度知道 编辑:UC知道 时间:2024/04/29 14:10:41
一共要填写3个地方, 有没有人帮帮忙

mport java.awt.*;
import javax.swing.*;
class PatternPanel extends JComponent {
RecursivePattern pattern; // the geometric pattern

/** Constructor of the PatternPanel
*/
public PatternPanel() {
}

/** create a new pattern
* @param ID the ID of the pattern
* @param order the order of the pattern
* @return true when pattern is created successfully
*/
public boolean createPattern(int ID, int order) {
Insets insets = getInsets();
int marginWidth = getWidth() - insets.left - insets.right;
int marginHeight = getHeight() - insets.top - insets.bottom ;
if (order >=0) {

// complete this
// create a new pattern and
// return true
第1个要写的地方
}
return false;
}

/** set the order of the pattern
* @param order the order value
* @return true when th

写的地方 加上功能说明吧
要不不知道你要让写什么

要补充代码的地方,是想要实现什么功能呀?

RecursivePattern 这个类贴出来看下··这样才能把问题搞明白··

import java.awt.*;
import javax.swing.*;

public class PatternPanel extends JComponent {
RecursivePattern pattern; // the geometric pattern

/** Constructor of the PatternPanel */
public PatternPanel() {
}

/**
* create a new pattern
*
* @param ID
* the ID of the pattern
* @param order
* the order of the pattern
* @return true when pattern is created successfully
*/
public boolean createPattern(int ID, int order) {
Insets insets = getInsets();
int marginWidth = getWidth() - insets.left - insets.right;
int marginHeight = getHeight() - insets.top - insets.bottom;
if (order >= 0) {

// complete this
// create a new pattern and
// return true
//********** 第1个要写的地方
pattern.setMarginSize(marginWidth, marginHeig