setBound(boolean) - Method in class java.beans.PropertyDescriptor
Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.
setBounds(int, int, int, int) - Method in class java.awt.Rectangle
Sets the bounding Rectangle of this Rectangle to the specified x, y, width, and height.
setBounds(int, int, int, int) - Method in class java.awt.Component
Moves and resizes this component.
setBounds(Rectangle) - Method in class java.awt.List.AccessibleAWTList.AccessibleAWTListChild
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in class java.awt.MenuComponent.AccessibleAWTMenuComponent
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in class java.awt.Rectangle
Sets the bounding Rectangle of this Rectangle to match the specified Rectangle.
setBounds(Rectangle) - Method in class java.awt.Component
Moves and resizes this component to conform to the new bounding rectangle r.
setBounds(Rectangle) - Method in class java.awt.Component.AccessibleAWTComponent
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in interface javax.accessibility.AccessibleComponent
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in class javax.swing.JList.AccessibleJList.AccessibleJListChild
setBounds(Rectangle) - Method in class javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode
setBounds(Rectangle) - Method in class javax.swing.JTable.AccessibleJTable.AccessibleJTableCell
setBounds(Rectangle) - Method in class javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry setPreferredSize(Dimension) - Method in class javax.swing.JComponent
Sets the preferred size of this component. Sets the signature provider's name.
setSize(Dimension) - Method in class java.awt.List.AccessibleAWTList.AccessibleAWTListChild
Resizes this object so that it has width and height.
setSize(Dimension) - Method in class java.awt.MenuComponent.AccessibleAWTMenuComponent
Resizes this object.
setSize(Dimension) - Method in class java.awt.Rectangle
Sets the size of this Rectangle to match the specified Dimension.
setSize(Dimension) - Method in class java.awt.Dimension
Sets the size of this Dimension object to the specified size.
setSize(Dimension) - Method in class java.awt.Component
Resizes this component so that it has width d.width and height d.height.
setSize(Dimension) - Method in class java.awt.Component.AccessibleAWTComponent
Resizes this object so that it has width width and height.
setSize(Dimension) - Method in interface javax.accessibility.AccessibleComponent
Resizes this object so that it has width and height.
setSize(Dimension) - Method in class javax.swing.JList.AccessibleJList.AccessibleJListChild
setSize(Dimension) - Method in class javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode
setSize(Dimension) - Method in class javax.swing.JTable.AccessibleJTable.AccessibleJTableCell
setSize(Dimension) - Method in class javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry
setSize(Dimension2D) - Method in class java.awt.geom.Dimension2D
Sets the size of this Dimension2D object to match the specified size.
setSize(double, double) - Method in class java.awt.Dimension
Sets the size of this Dimension object to the specified width and height in double precision.
setSize(double, double) - Method in class java.awt.geom.Dimension2D
Sets the size of this Dimension object to the specified width and height.
setSize(double, double) - Method in class java.awt.print.Paper
Sets the width and height of this Paper object, which represents the properties of the page onto which printing occurs.
setSize(float, float) - Method in class javax.swing.text.PlainView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.AsyncBoxView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.WrappedPlainView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.BoxView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.View
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.html.ImageView
Sets the size of the view.
setSize(int) - Method in class java.util.Vector
Sets the size of this vector.
setSize(int) - Method in class javax.swing.DefaultListModel
Sets the size of this list.
setSize(int, int) - Method in class java.awt.Rectangle
Sets the size of this Rectangle to the specified width and height.
setSize(int, int) - Method in class java.awt.Dimension
Sets the size of this Dimension object to the specified width and height.
setSize(int, int) - Method in class java.awt.Component
Resizes this component so that it has width width and height height.
setSize(int, int) - Method in class javax.swing.SizeSequence
Sets the size of the specified entry.
setSize(long) - Method in class java.util.zip.ZipEntry
Sets the uncompressed size of the entry data.
setSizes(int[]) - Method in class javax.swing.SizeSequence
Resets this SizeSequence object, using the data in the sizes argument.
setSizes(int[]) - Method in class javax.swing.plaf.basic.BasicSplitPaneUI.BasicHorizontalLayoutManager
Sets the sizes to newSizes.
Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.
setBounds(int, int, int, int) - Method in class java.awt.Rectangle
Sets the bounding Rectangle of this Rectangle to the specified x, y, width, and height.
setBounds(int, int, int, int) - Method in class java.awt.Component
Moves and resizes this component.
setBounds(Rectangle) - Method in class java.awt.List.AccessibleAWTList.AccessibleAWTListChild
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in class java.awt.MenuComponent.AccessibleAWTMenuComponent
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in class java.awt.Rectangle
Sets the bounding Rectangle of this Rectangle to match the specified Rectangle.
setBounds(Rectangle) - Method in class java.awt.Component
Moves and resizes this component to conform to the new bounding rectangle r.
setBounds(Rectangle) - Method in class java.awt.Component.AccessibleAWTComponent
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in interface javax.accessibility.AccessibleComponent
Sets the bounds of this object in the form of a Rectangle object.
setBounds(Rectangle) - Method in class javax.swing.JList.AccessibleJList.AccessibleJListChild
setBounds(Rectangle) - Method in class javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode
setBounds(Rectangle) - Method in class javax.swing.JTable.AccessibleJTable.AccessibleJTableCell
setBounds(Rectangle) - Method in class javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry setPreferredSize(Dimension) - Method in class javax.swing.JComponent
Sets the preferred size of this component. Sets the signature provider's name.
setSize(Dimension) - Method in class java.awt.List.AccessibleAWTList.AccessibleAWTListChild
Resizes this object so that it has width and height.
setSize(Dimension) - Method in class java.awt.MenuComponent.AccessibleAWTMenuComponent
Resizes this object.
setSize(Dimension) - Method in class java.awt.Rectangle
Sets the size of this Rectangle to match the specified Dimension.
setSize(Dimension) - Method in class java.awt.Dimension
Sets the size of this Dimension object to the specified size.
setSize(Dimension) - Method in class java.awt.Component
Resizes this component so that it has width d.width and height d.height.
setSize(Dimension) - Method in class java.awt.Component.AccessibleAWTComponent
Resizes this object so that it has width width and height.
setSize(Dimension) - Method in interface javax.accessibility.AccessibleComponent
Resizes this object so that it has width and height.
setSize(Dimension) - Method in class javax.swing.JList.AccessibleJList.AccessibleJListChild
setSize(Dimension) - Method in class javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode
setSize(Dimension) - Method in class javax.swing.JTable.AccessibleJTable.AccessibleJTableCell
setSize(Dimension) - Method in class javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry
setSize(Dimension2D) - Method in class java.awt.geom.Dimension2D
Sets the size of this Dimension2D object to match the specified size.
setSize(double, double) - Method in class java.awt.Dimension
Sets the size of this Dimension object to the specified width and height in double precision.
setSize(double, double) - Method in class java.awt.geom.Dimension2D
Sets the size of this Dimension object to the specified width and height.
setSize(double, double) - Method in class java.awt.print.Paper
Sets the width and height of this Paper object, which represents the properties of the page onto which printing occurs.
setSize(float, float) - Method in class javax.swing.text.PlainView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.AsyncBoxView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.WrappedPlainView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.BoxView
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.View
Sets the size of the view.
setSize(float, float) - Method in class javax.swing.text.html.ImageView
Sets the size of the view.
setSize(int) - Method in class java.util.Vector
Sets the size of this vector.
setSize(int) - Method in class javax.swing.DefaultListModel
Sets the size of this list.
setSize(int, int) - Method in class java.awt.Rectangle
Sets the size of this Rectangle to the specified width and height.
setSize(int, int) - Method in class java.awt.Dimension
Sets the size of this Dimension object to the specified width and height.
setSize(int, int) - Method in class java.awt.Component
Resizes this component so that it has width width and height height.
setSize(int, int) - Method in class javax.swing.SizeSequence
Sets the size of the specified entry.
setSize(long) - Method in class java.util.zip.ZipEntry
Sets the uncompressed size of the entry data.
setSizes(int[]) - Method in class javax.swing.SizeSequence
Resets this SizeSequence object, using the data in the sizes argument.
setSizes(int[]) - Method in class javax.swing.plaf.basic.BasicSplitPaneUI.BasicHorizontalLayoutManager
Sets the sizes to newSizes.
解决方案 »
- 第三方jar 打包问题
- JEditorPane setPage() 问题?? 急~
- 请用最快(最有效率)的方法对以下规则的字符串进行排序
- 高手请教!!!!!!!!!!!
- 早起的大哥们快进来!!20分给您了!!!
- jsp里如何获取传递的参数个数?
- about debug (jcreator)??
- 为什么在我的JBuilder8里面不能添加struts 1.1版本的struts代码了????
- 请问运行java的appletviewer那里可能下载?
- java 怎么调用VB做的DLL,
- jdk1.1.1为何javac成功,但是JAVA HELLOWORLD时候就出现CAN NOT FIND CLASS HELLOWORLD
- 到底是太简单还是太难啊,怎么问了三次都没人答呢?
setBounds():可以设置一个控件的坐标及大小(即左上角坐标和宽度及高度).
SizesetSize()指定控件的大小(宽,高);
setBounds指定控件的坐标及大小(左上角坐标和宽度及高度).
setSize(), 设置宽度及高度setPreferredSize(), 得到组件的最佳Size。比如有一个JTextField, 它的大小就取决于它的text的长度、字体。setBounds() 设置左上角坐标和宽度及高度-------------------------
没有最好,只有更好
没有更细,只有更简
setSize()的参数是以象素为单位的
setSize设置的width和height把标题栏和边框都算进去
2\setPreferredSize()
只是向布局管理器建议,但布局管理器接受不接受还很难说,有时你需要把布局管理器设为空3\setBounds有时要在上面加一句:this.getContentPane.setLayout(null);把布局器取消掉
public class Testgui extends JFrame {
JComboBox sizeCombo = new JComboBox(new Object[]{"null","100*100","200*200"});
JList list = new JList(new Object[]{"item 1","item 2","item 3","item 4","item 5",});public void init(){
final Container contentPane = getContentPane();
list.setBorder(BorderFactory.createLineBorder(Color.black));
sizeCombo.setSelectedIndex(0);
contentPane.setLayout(new FlowLayout());
contentPane.add(list);
contentPane.add(new JLabel("preferred size for list:"));
contentPane.add(sizeCombo);
sizeCombo.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){ int index = sizeCombo.getSelectedIndex();
if(index==0)
list.setPreferredSize(null);
else if(index==1)
list.setPreferredSize(new Dimension(100,100));
else
list.setPreferredSize(new Dimension(400,400));
list.revalidate();
}
});
System.out.println(list.getMaximumSize());}
public static void main(String args[]){
Testgui g = new Testgui();
g.init();
g.setVisible(true);
}
}这里改成list.setBounds(100,200);
list.setSize(new Dimension(100,100));
为何就不行呢?