我查手册和源码,还是无法找到这个函数原型
解决方案 »
- 麻烦各位.帮个忙看个题目.关于圆形角度的问题
- servlet输出html路径问题~!
- JTable如何在setValueAt(object, row, col)后仍保持可写?
- 新手求助:父类与子类对象的转换
- 为和我写的java程序会占用全部的cpu资源,如何做到尽量少占资源?
- 如何在jsp页面中将数据库中编码格式为WE8DEC的字符转换...
- 第一次使用JCreator 为什么在其中录入的汉字显示的是乱码?怎么设置
- 如何在使用JTable的窗口一打开时就高亮度显示表中的一条记录?
- 请教
- 在线程a中使线程b结束,语句应怎样写?
- 我想让java程序占用服务器的6060端口,怎么做呢?
- 论坛中的人有在北京工作的吗
Object constraints)
应该是这个方法吧...
Object constraints)Adds the specified component to the end of this container. Also notifies the layout manager to add the component to this container's layout using the specified constraints object. This is a convenience method for addImpl(java.awt.Component, java.lang.Object, int).
Note: If a component has been added to a container that has been displayed, validate must be called on that container to display the new component. If multiple components are being added, you can improve efficiency by calling validate only once, after all the components have been added.
Parameters:
comp - the component to be added
constraints - an object expressing layout contraints for this component
Throws:
NullPointerException - if comp is null
Adds the specified component to the end of this container. Also notifies the layout manager to add the component to this container's layout using the specified constraints object. This is a convenience method for addImpl(java.awt.Component, java.lang.Object, int).
Note: If a component has been added to a container that has been displayed, validate must be called on that container to display the new component. If multiple components are being added, you can improve efficiency by calling validate only once, after all the components have been added.
Parameters:
comp - the component to be added
constraints - an object expressing layout contraints for this component
Throws:
NullPointerException - if comp is null
public void add(Component comp, Object constraints) {...}
其中 JButton 间接继承自 Component,String 更不用说了。
为什么不能直接是:
public void add(Component comp, String name) {...}