getContentPane问题 eclipse getContentPane() 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 this. getContentPane 把不然怎么编译怎么找到 试过了,不行,他是继承类,我把整个程序都贴出来吧package test;import javax.swing.*;import java.awt.*;class FrameTest{ JFrame frameObj; public FrameTest() { frameObj=new JFrame("window"); frameObj.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frameObj.setVisible(true); frameObj.setSize(600,400); }}class ButtonTest extends FrameTest{ JButton buttonObj1; JButton buttonObj2; JButton buttonObj3; JButton buttonObj4; public ButtonTest() { buttonObj1=new JButton("播放"); buttonObj2=new JButton("上一首"); buttonObj3=new JButton("下一首"); buttonObj4=new JButton("暂停"); getContentPane().add("West",buttonObj1); getContentPane().add(buttonObj2); getContentPane().add(buttonObj3); getContentPane().add(buttonObj4); }}class FlowLayoutTest extends ButtonTest{ FlowLayoutTest layoutObj; public FlowLayoutTest() { layoutObj=new FlowLayoutTest(); getContentPane().setLayout(layoutObj); }}public class J1_Frame{ public static void main(String[] args) { new FlowLayoutTest(); }} 好吧 你看的什么书啊 getContentPane这个东西是谁的呢?呵呵你看你代码 你那个对象有 getContentPane了 是jframe?class FrameTest{ JFrame frameObj; public FrameTest() { frameObj=new JFrame("window"); frameObj.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frameObj.setVisible(true); frameObj.setSize(600,400);} public ??? getContentPane(){ //这里的??? 你自己写一下返回类型 return this.frameObj.getContentPane(); }}另外1合理情况应该FrameTest 继承JFrame另外JFrame是不是可以直接 add 控件了你要看看api 我在FrameTest中继承了一下JFrame就解决问题了 请问如何用JS计算分数排名 针对javascript处理二进制流,遇到乱码charCodeAt会将其转为65533,怎么破 JQUERY 动态+标记元素 但双引号 问题 请问在js中是不是回调函数的定义有两种? 大家好,这是一个关于两个textbox之间实时传送数据的程序,请教 <input name="download" type="file" > 点浏览后选择一个文件 如何得到框内的值?? form表单元素更改name无效 如何实现点一个按纽,让一个desabled东西变成可用? 正则表达式中的“/-/g”是什么意思啊? eXT的问题得到Form中的gridcm 图片上传
不然怎么编译怎么找到
package test;
import javax.swing.*;
import java.awt.*;class FrameTest
{
JFrame frameObj;
public FrameTest()
{
frameObj=new JFrame("window");
frameObj.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frameObj.setVisible(true);
frameObj.setSize(600,400);
}
}
class ButtonTest extends FrameTest
{
JButton buttonObj1;
JButton buttonObj2;
JButton buttonObj3;
JButton buttonObj4;
public ButtonTest()
{
buttonObj1=new JButton("播放");
buttonObj2=new JButton("上一首");
buttonObj3=new JButton("下一首");
buttonObj4=new JButton("暂停");
getContentPane().add("West",buttonObj1);
getContentPane().add(buttonObj2);
getContentPane().add(buttonObj3);
getContentPane().add(buttonObj4);
}
}
class FlowLayoutTest extends ButtonTest
{
FlowLayoutTest layoutObj;
public FlowLayoutTest()
{
layoutObj=new FlowLayoutTest();
getContentPane().setLayout(layoutObj);
}
}
public class J1_Frame
{
public static void main(String[] args)
{
new FlowLayoutTest();
}
}
你看你代码 你那个对象有 getContentPane了
是jframe?class FrameTest
{
JFrame frameObj;
public FrameTest()
{
frameObj=new JFrame("window");
frameObj.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frameObj.setVisible(true);
frameObj.setSize(600,400);
}
public ??? getContentPane(){ //这里的??? 你自己写一下返回类型
return this.frameObj.getContentPane();
}
}另外1合理情况应该FrameTest 继承JFrame
另外JFrame是不是可以直接 add 控件了
你要看看api