miglayout

Cross platform UI spacing/padding

旧巷老猫 提交于 2019-12-11 03:24:15
问题 I have written a Java UI using the SWT UI library and the MigLayout layout library. This page shows screenshots of the UI on Windows, Linux and OSX: http://mchr3k.github.com/org.intrace/screenshots.html On Linux and OSX my UI has a lot more padding and spacing which I feel wastes a lot of screen space. Is this normal for these platforms? If not, what is the best way to work around this? EDIT: the linked screenshots have now been updated and no longer show an extra gap on OSX as I have

JSplitPane + MiGLayout: how to enable autoresizing

笑着哭i 提交于 2019-12-11 03:11:20
问题 I'm doing something wrong here: I want to have two JButtons in a JSplitPane in a JPanel in a a JFrame, where the buttons fill the JSplitPane. Here's what I get when I resize the JFrame: The buttons stay their normal size, and the JSplitPane doesn't allow adjusting.something How do I fix this? import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JSplitPane; import net.miginfocom.swing.MigLayout; public class SplitPaneQuestion { public static void

Lining up components in a grid with grid-based background

倖福魔咒の 提交于 2019-12-11 02:24:18
问题 I'm working on a college project and I'm having difficulty lining up components with the board grid. The board will always maintain a 1:1 width to height ratio but the size can vary. Here is what I've tried which resulted in this: Why are the percentages not lining up with what I calculated them to be for the actual image size of 1200x1200? Here's my layout code: public class BoardPanel extends ViewComponent { public static final int ROWS = 27; public static final int COLS = 23; private Board

What is causing slow performance in my JTabbedPane-based Swing application?

南楼画角 提交于 2019-12-11 02:20:35
问题 I have a Swing application for creating RPG characters. It has a nested JTabbedPane architecture, so there is a HeroTabsPanel which has HeroPanels and each of those has some more tabs like Stats, Items etc. So the GUI is comprised of the upper tabbed pane for heroes, the lower tabbed pane for current hero tab and an EditViewPanel which displays an EditingView corresponding to each Tab when the tab is selected. Performance has been bad from the start, but when I added the upper level hero-tabs

Force MigLayout shrink like GridBagLayout for hidden Objects

自古美人都是妖i 提交于 2019-12-10 15:05:09
问题 I am trying to replace GridBagLayout with MigLayout . The problem is that if i call obj.setVisible(false) for some object in GridBaglayout , the layout shrinks. But in MigLayout it just remains hidden. Do you know some way to make MigLayout acting like GridBagLayout ? 回答1: Have a look at the "hidemode" property on the MigLayout Cheat Sheet over here: http://www.migcalendar.com/miglayout/cheatsheet.html You probably want new MigLayout("hidemode 3") 来源: https://stackoverflow.com/questions

Dynamically rearrange layout with Swing

♀尐吖头ヾ 提交于 2019-12-10 05:32:12
问题 I am building a desktop app with Swing with similar functionality to Twitter. I have a "feed" page where "tweets" are displayed. I have the "tweets" in a JPanel and want to dynamically display new ones coming in by placing new "tweets" at the top of the JPanel and moving older ones down. I was trying to do this with MigLayout by using jpanel.add(tweet, "cell 0 0, wrap") however this didn't work as intended and in order to get it to display with the layout I wanted I had to call jpanel

How to center a component on a row containing multiple components with MiGLayout

烈酒焚心 提交于 2019-12-09 15:06:27
问题 I started using MiGLayout about a month and half ago and everything is simple and works great. There's only one issue I still have that I haven't been able to fix. Let's say I want to have a row that has two buttons on the right-most side and a centered title, the title doesn't actually get centered when I do it this way: ("this" is a JPanel) this.add(labelTitle, "split, span, center"); this.add(closeButton, "east"); this.add(mainMenuButton, "east"); What happens is that "labelTitle" is

How I can do swing complex layout Java [closed]

白昼怎懂夜的黑 提交于 2019-12-09 03:59:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I need a help about a java swing layout. I want do any thing like that (please see the image): http://i1374.photobucket.com/albums/ag420/Bruno_Freitas/PROGRAMADEPONTUACcedilAtildeO_zpsebaf314e.jpg I tried put a grid bag layout, but I could not insert a floatting JPanel with the content 10:00 (on image). Anyone

Java Vertical Layout?

*爱你&永不变心* 提交于 2019-12-08 14:46:50
问题 I need to position a JLabel over some JButtons, vertically, like a game menu. They should all be centered. I already downloaded MigLayout, but I'm not sure how to use that, so I just want a way to position my components vertically and centered, MigLayout or not. Also, I don't want to use a IDE GUI designer. 回答1: You might use a (single column) GridLayout or BoxLayout for this. See Using Layout Managers & A Visual Guide to Layout Managers for more tips, ideas and working source. 回答2: You

MigLayout column constraint

◇◆丶佛笑我妖孽 提交于 2019-12-08 08:08:23
问题 I'm trying to develop an application layout like that: * +------------------+--------+ * | | | * | | | * | | | * | 70% | 30% | * | | | * | | | * | | | * | | | * | | | * +------------------+--------+ To do this, I'm using MigLayout. According to this cheat sheet, to set the column weight we shold use [weight] . However, it isn't working somehow. Take a look at my code: package com.test; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel;