source: java/main/src/main/java/com/framsticks/util/Layout.java @ 77

Last change on this file since 77 was 77, checked in by psniegowski, 11 years ago

Add new java codebase.

File size: 600 bytes
Line 
1package com.framsticks.util;
2
3
4import javax.swing.*;
5import java.awt.*;
6
7/**
8 * @author Piotr Sniegowski
9 */
10public class Layout {
11        public static void fixComponentSize(JComponent component, Dimension dimension) {
12                component.setPreferredSize(dimension);
13                component.setMaximumSize(dimension);
14                component.setMaximumSize(dimension);
15        }
16
17        public static void copyComponentDimensions(JComponent destination, JComponent source) {
18                destination.setPreferredSize(source.getPreferredSize());
19                destination.setMaximumSize(source.getMaximumSize());
20                destination.setMinimumSize(source.getMinimumSize());
21        }
22
23}
Note: See TracBrowser for help on using the repository browser.