This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
swing:start [2015/05/02 13:10] gthanos [Flow Layout Manager] |
swing:start [2015/05/02 13:25] gthanos [FlowLayout Manager] |
||
---|---|---|---|
Line 90: | Line 90: | ||
super(); | super(); | ||
setSize(300, 150); | setSize(300, 150); | ||
- | setTitle("BorderLayout Demo"); | + | setTitle("FlowLayout Demo"); |
- | setLayout(new FlowLayout()); | + | |
+ | /* Select FlowLayout.LEFT for left alignment. | ||
+ | * Select FlowLayout.RIGHT for right alignment. | ||
+ | * Select FlowLayout.CENTER for center alignment (this is the default). | ||
+ | */ | ||
+ | setLayout(new FlowLayout(FlowLayout.LEFT)); | ||
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); | setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); | ||
| | ||
Line 129: | Line 134: | ||
} | } | ||
</code> | </code> | ||
+ | |||
+ | Το παράθυρο που προκύπτει δίνεται παρακάτω. | ||
+ | {{ :swing:flowlayoutdemo.png |}} | ||
===== Grid Layout Manager ===== | ===== Grid Layout Manager ===== |