Top "Preferredsize" questions

How to specify Jlist width?

I want to specify fixed width of my JList I followed example provided by Gilbert Le Blanc 22k getContentPane().setLayout(…

java swing layout-manager jlist preferredsize
Creating a simple custom JComponent in Java?

I want to start building my own customized JComponent's for a project at work. I have a simple example below …

java swing paintcomponent jcomponent preferredsize
JFrame size is too small

i have created a JFrame in netbeans. But when i run the program, the Jframe size is too small. here …

java swing jframe preferredsize
How to set size of JTextField in pixels

Hey I was just wondering if there is a way to set JTextField width for example 50% of the screen size. …

java swing user-interface jtextfield preferredsize
How to set a size for JMenuItem?

As you can see, it's ugly to have these kind of JMenuItems. The width of the menu items is quite …

java swing jmenu jmenuitem preferredsize
Set a column width of JTable according to the text in a header

I need to get an appropriate table size according to a text in a header. It contains abbreviations of czech …

java swing jtable jtableheader preferredsize
JTable: set column width based on header size

I have a JTable and header contains string of different type: table = new JTable(new DefaultTableModel(info, myHeader){ public boolean …

java swing jtable jtableheader preferredsize
How to make Jpanel expand to the size of the JFrame?

The below code is from the book objects First With Java By Michale Kolling and David J Barnes and the …

java jframe jpanel paint preferredsize
Size of buttons inside GridBagLayout

I have an 3 * 6 array of JButtons inside a GridBagLayout. But since the text length of each button may vary, each …

java swing jbutton gridbaglayout preferredsize
java swing design to create a textfield

I want to create a jtext field with a definite size, but I would like it to expand like a …

java swing jtextfield jtextarea preferredsize