如何使JPanel可滚动?当我将它添加到包含面板时,我实现了可滚动界面
tabbedPane.add("Editor", new JScrollPane(storeyEditor = new MNScrollablePanel()));
Run Code Online (Sandbox Code Playgroud)
什么都行不通
码:
public class MNScrollablePanel extends JPanel implements Scrollable {
public Dimension getPreferredScrollableViewportSize() {
return getPreferredSize();
}
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) {
return 10;
}
public boolean getScrollableTracksViewportHeight() {
return false;
}
public boolean getScrollableTracksViewportWidth() {
return false;
}
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
return 10;
}
}
Run Code Online (Sandbox Code Playgroud) 我在Objective-C中使用它我有这个结构:
- (void)init {
if (self = [super init]) {
// init class
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
Python是否也应该调用父类的实现__init__?
class NewClass(SomeOtherClass):
def __init__(self):
SomeOtherClass.__init__(self)
# init class
Run Code Online (Sandbox Code Playgroud)
对于__new__()和,这也是真/假__del__()吗?
编辑:有一个非常类似的问题:Python中的继承和覆盖__init__
哪个Doxygen选项可以完全禁用按类型排序成员(私有/公共/方法/变量),输出成员纯粹基于它们的声明顺序?
我如何通过我的PHP代码访问我的Gmail帐户?我需要从我的gmail帐户获取主题和地址.然后我需要将访问标记为在gmail上读取我应该使用gmail pop3 clint吗?是我可以用来访问gmail pop3服务器的任何框架.
请考虑以下事项:
#include <stdio.h>
main() {
unsigned long long verybig = 285212672;
printf("Without variable : %llu\n", 285212672);
printf("With variable : %llu", verybig);
}
Run Code Online (Sandbox Code Playgroud)
这是上述程序的输出:
Without variable : 18035667472744448
With variable : 285212672
Run Code Online (Sandbox Code Playgroud)
从上面可以看到,当printf将数字作为常量传递时,它会输出一些巨大的错误数字,但是当该值首次存储在变量中时,会printf输出正确的数字.
这背后的原因是什么?
我正在尝试用c ++制作一个简单的绘图应用程序,但是我很难找到填充椭圆的函数,我发现只有FillRect,有人能引导我朝着正确的方向前进吗?谢谢
欧元(€)是22个欧洲国家的官方货币.
在HTML中,有不同的可能性来显示标志€:
€€€你会在HTML中使用哪一个?我认为并非所有浏览器都支持任何表示形式.遗憾的是,没有标准的方式来显示标志.
你能推荐一种陈述吗?有什么区别?哪种支持最好?
我希望你能帮助我.非常感谢你提前!