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.
解决方案 »
- Eclipse鼠标悬停提示功能的延迟时间设置
- 我通过odbc数据源连接sql server2000 求救!!
- 关于 java 编码 转换
- 关于StringTokenizer的使用!!急!! 高分!
- 用贪婪法解决翻译匹配的问题(大量字符串替换)
- servlet中可以引用自己定义的累吗
- SimpleDateFormat.parse()
- 问一下在那里可以下到关于java的帮助,类似MSDN的那种帮助!谢谢了
- 工作快完了出现了问题,,关于数据库的知识.愿意献出200分
- 能提供Jbuilder 5的下载地址吗?
- 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));
为何就不行呢?