Unterschiede
Hier werden die Unterschiede zwischen der gewählten und der aktuellen Version gezeigt.
| swing:jcombobox-layout 2011/09/05 10:24 | swing:jcombobox-layout 2020/01/22 20:59 aktuell | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== JComboBox, Layout ====== | + | [[swing:swing|Java - AWT/Swing]]\\ |
| + | ====== JComboBox, Layout (Breite festlegen) ====== | ||
| Das Layout mit einer JComboBox kann unter umständen etwas kompliziert sein.\\ | Das Layout mit einer JComboBox kann unter umständen etwas kompliziert sein.\\ | ||
| - | Die PreferredSize einer JComboBox ist bei langen Texteinträgen nämlich die breite des längsten Eintrags.\\ | + | Die PreferredSize einer JComboBox ist bei langen Texteinträgen nämlich die Breite des längsten Eintrags.\\ |
| - | Diese eigentschaft kann unter Umständen dazu führen, dass das ganze Layout zerstört wird.\\ | + | Diese Eigentschaft kann unter Umständen dazu führen, dass das ganze Layout zerstört wird.\\ |
| - | Einfache Abhilfe ist das Setzten der PreferredSize: | + | Einfache Abhilfe ist das manuelle Setzten der PreferredSize: |
| - | <code jav> | + | \\ |
| + | <html> | ||
| + | <script type="text/javascript"><!-- | ||
| + | google_ad_client="pub-9681858985507948"; | ||
| + | google_ad_width = 468; | ||
| + | google_ad_height = 60; | ||
| + | google_ad_format = "468x60_as"; | ||
| + | google_ad_type = "text"; | ||
| + | google_ad_channel = ""; | ||
| + | google_color_border = "cccccc"; | ||
| + | google_color_bg = "FFFFFF"; | ||
| + | google_color_link = "1d2d8c"; | ||
| + | google_color_text = "000000"; | ||
| + | google_color_url = "1d2d8c"; | ||
| + | //--> | ||
| + | </script> | ||
| + | <script type="text/javascript" | ||
| + | src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> | ||
| + | </script> | ||
| + | </html> | ||
| + | \\ | ||
| + | <code java> | ||
| JBomboBox cb = new JComboBox(); | JBomboBox cb = new JComboBox(); | ||
| cb.setPreferredSize(60, cb.getPreferredSize().height); | cb.setPreferredSize(60, cb.getPreferredSize().height); | ||
| </code> | </code> | ||
| + | |||
| + | |||