Skip to main content

Posts

Showing posts with the label layout

How to layout widgets using DockLayoutPanel and UiBinder in GWT 2.0?

I'm trying to get a simple layout working under GWT 2.0 using UiBinder. The layout I'm trying to get is one that mimic Java's BorderLayout in where you can specify different panels in the north, south, east, west and center directions; for that I'm using DockLayoutPanel. I would like to get a header and footer, both with fixed width. The remaining viewport space would be occupied by the widget assigned to the DockLayoutPanel center slot.

BoxLayout can"t be shared error

I have this Java JFrame class, in which I want to use a boxlayout, but I get an error saying java.awt.AWTError: BoxLayout can't be shared . I've seen others with this problem, but they solved it by creating the boxlayout on the contentpane, but that is what I'm doing here. Here's my code: class edit_dialog extends javax.swing.JFrame{ javax.swing.JTextField title = new javax.swing.JTextField(); public edit_dialog(){ setDefaultCloseOperation(javax.swing.JFrame.DISPOSE_ON_CLOSE); setTitle("New entity"); getContentPane().setLayout( new javax.swing.BoxLayout(this, javax.swing.BoxLayout.PAGE_AXIS)); add(title); pack(); setVisible(true); } }

Java - How to resize components in GroupLayout

., Hello, I have a problem with GroupLayout . My code is: public chat () { JTextField chatbox; JTextField msgbox; JButton sendbutton; GroupLayout layout; super(); chatbox = new JTextField(); msgbox = new JTextField(); sendbutton = new JButton("Send"); layout = new GroupLayout(this); sendbutton.setPreferredSize(new Dimension(60, 20)); setBackground(new Color(255, 255, 255)); setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true); layout.setHorizontalGroup(layout.createParallelGroup() .addComponent(chatbox) .addGroup(layout.createSequentialGroup() .addComponent(msgbox) .addComponent(sendbutton)) ); layout.linkSize(SwingConstants.HORIZONTAL, sendbutton); layout.setVerticalGroup(layout.createSequentialGroup() .addComponent(chatbox)

How do I make a GUI that looks like the attached picture of a simple stock market app?

Using these layouts; FlowLayout, BoxLayout, GridLayout, BorderLayout and GridBagLayout im trying to make my GUI look like below. I tried Flow, Grid and Border but I couldn't make it look the same.

Android - Layout with images

I've been working on this for few days but I couldn't get the layout I need. I would like to have a layout similar to the image below. Can anyone guide me with this ? What kind of layout and view should I use ? Thanks :)