我想在文本字段中显示变量字符串。我正在使用这个功能
public class Shape{
public void displayShape(){
System.out.println("shape displayed");
}
public class Circle extends Shape{
public void drawCircle(){
System.out.println("circle drawn");
}
public class Test{
p.s.v.main(String[] a){
Circle c=new Circle();
Shape s=new Shape();
display(c);
display(s);
public void display(Shape myShape){
myShape.displayShape();//possible for ref variable c and s
myShape.drawCircle();//not possible for reference var s
}
}
}
现在我希望在此文本字段中打印此file_path
def buttonClick():
file_path = askopenfilename(filetypes=(("Android Application Files", ".apk"), ("All files", "*.*")))
print file_path
我该怎么做?
答案 0 :(得分:0)
我会尝试这个
self.fnameVar = StringVar()
self.fnameEntry = Entry(textvariable=self.fnameVar)
self.fnameVar.set(file_path)