1 px wide and 2 px high are valid sizes for a component. (0, 0) is a valid size. The method does not deal with size in pixels, it takes a Dimension as the only parameter.
Type: Posts; User: jps
1 px wide and 2 px high are valid sizes for a component. (0, 0) is a valid size. The method does not deal with size in pixels, it takes a Dimension as the only parameter.
//This is the part that is not working
calculate1.setPreferredSize(1,2);
setPreferredSize() takes a Dimension as a parameter
There are several methods that would set a dimension for a component, (some of which have been depreciated). Can you post a SSCCE that shows where you are setting the size?
Layout managers...
What have you tried?
How is the layout managed? ...with a layout manager or other?