🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.java
2 messages
2 total messages Started by Borneq Mon, 14 Jul 2014 07:24
Jakiego layoutu użyć?
#154080
Author: Borneq
Date: Mon, 14 Jul 2014 07:24
15 lines
1386 bytes
Chciałbym mieć tak jak w Delphi - formę, na niej w pewnym miejscu 
button, gdzie indziej pole tekstowe. Użyłem BoxLayout:
		button = new JButton();
		panel = new JPanel();
		panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
		this.add(panel);
		button.setSize(new Dimension(100,100)); //to nic nie robi
		button.setText("Test");
		panel.add(button);
		textArea = new JTextArea();
		panel.add(textArea);
		panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));

Mam u góry po lewo button, resztę zajmuje pole tekstowe, jednak gdy coś 
piszę, to button się przesuwa.
Re: Jakiego layoutu użyć?
#154073
Author: Michal Kleczek
Date: Tue, 15 Jul 2014 16:46
22 lines
1730 bytes
Borneq wrote:

> Chciałbym mieć tak jak w Delphi - formę, na niej w pewnym miejscu
> button, gdzie indziej pole tekstowe. Użyłem BoxLayout:
> button = new JButton();
> panel = new JPanel();
> panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
> this.add(panel);
> button.setSize(new Dimension(100,100)); //to nic nie robi
> button.setText("Test");
> panel.add(button);
> textArea = new JTextArea();
> panel.add(textArea);
> panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
> 
> Mam u góry po lewo button, resztę zajmuje pole tekstowe, jednak gdy coś
> piszę, to button się przesuwa.

Czyżby interesowal Cie AbsoluteLayout?

-- 
Michal
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads