layout

How do I keep JTextFields in a Java Swing BoxLayout from expanding?

I have a JPanel that looks something like this: JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); ... panel.add(jTextField1); panel.add(Box.createVerticalStrut(10)); panel.add(jButton1); panel.add(Box.createVerticalStrut(30)); panel.add(jTextField2); panel.add(Box.createVerticalStrut(10)); panel.a...

Android XML - how to get items aligned far left, center, and far right

Hi, I have this XML code which generates a button, a textview and another button, How do I go about getting the button to appear in far left, the textview in the center and the last button on the far right? < ?xml version="1.0" encoding="utf-8"?> < LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fil...

Any wrapping viewgroup?

I am looking for Wrappable ViewGroup just like what TextView do. I need this for layout. This should be something like LinearLayout but wrappable to multiple lines. Or do I need something custom? ...

UL+CSS for grid layout

Hi all, I have a server-generated html like: <ul> <li><!-- few nested elements that form a block --></li> <li><!-- few nested elements that form anaother block --></li> <li><!-- etc, X times --></li> </ul> All blocks have known width 200px and unknown height. I want <li> to be arranged in table-like fashion like this: ...

More compact layout

In the following code, I'd like to get rid of the margin around the buttons. I'd like to have the buttons stretch all the way to the edge of the frame. How can I do that? import sys from PyQt4.QtGui import * from PyQt4.QtCore import * app = QApplication(sys.argv) window = QWidget() layout = QVBoxLayout() layout.setSpacing(0) window....

EditText, inputType values (xml)

Where can I find the values that inputType can have? I'm aware of http://developer.android.com/reference/android/text/InputType.html, but how should the values look like in layout xml files? ...

What is the difference between android:layout_width and android:width

I do not know the difference between these two attributes and for the height also. Take a TextView for example, what would happen if I set its layout_width to wrap_content and set its width to 50 dip? ...

Dynamic Windows Forms Components (Performance problem)

I have a problem with performance of my code under Windows Forms. Have a form, her layout is depending on constructor data, because he layout must be OnLoad or in Constructor generated. I generation is simple, base FlowLayoutPanel have other FlowLayoutPanels, for each have a Label and TextBox with DataBinding. Problem is this is VERY S...

How to customise the TextView inside a Spinner?

I have a Spinner with an ArrayAdapter that feeds Values into it. The layout for this views looks something like this: <TextView android:text="Household Income: " android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" /> <Spinn...

Android Set ImageButton as Toggle

How can I have an imagebutton stay in the 'pressed' state when it is clicked? Basically I just want the background to be the depressed background, but I can't figure out how to set it. At the moment, I've just copied the selected button background into my res folder, but when I set it as the background, it becomes blurry (since the origi...

Custom layout in Android: scrollable graphic with selectable elements over top

Hi, I'm fairly new to the Android platform and was wondering if I could get some advice for my current head scratcher: I'm making an app which in one view will need an image, which can be scrolled on one axis, with a load of selectable points over the top of it. Each point needs to be positionable on the x and y (unlikely to change on...

Reserve space for initially hidden widget in QVBoxLayout within QScrollArea

I am using a QVBoxLayout to arrange a vertical stack of widgets. The QVBoxLayout is contained within a QScrollArea. I want some of the widgets to be initially hidden and only show up when a check box is checked. Here is an example of the code I'm using. MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { QVBoxLayout *layout =...

How to create small SPACES in HTML?

There is em dash and en dash. Is there an "en" equivalent to &nbsp; ? Is there an en equivalent to pure Ascii 32? I want a better way to write this: 123<span class="spanen">&nbsp;</span>456<span class="spanen">&nbsp;</span>789 or this: 123<span class="spanen"> </span>456<span class="spanen"> </span>789 ...

WPF: Order of stretch sizing

I'm creating a modal dialog window which contains three essential parts: a TextBlock containing instructions, a ContentControl for the dialog panel, and a ContentControl for the dialog buttons. Each of these parts are contained in a separate Grid row. I have some specific constraints when it comes to how the dialog should be sized. The ...

How to correctly size containing views

I have an Activity that will display a custom view made up of 2 parts. I want one part to be 1/3 of visible screen height, the other part to be 2/3. I can override onMeasure and use display metrics to find the height of the display, but this does not account for the battery bar or view title sizes. DisplayMetrics dm = new DisplayMetri...

How to change the color of an indefinite ProgressBar?

I have a progressbar with the following style: style="?android:attr/android:progressBarStyleSmall" Sadly the bar is nearly white and in my case displayed on a white background. The progressbar is nearly invisible because of that. How can I change the color of the progressbar? A darker grey would be great. ...

Weird splitter behaviour when moving it

My demo app displays two rectangles which should fill whole browser's screen. There is a vertical splitter between them. This looks like a basic scenario but I have no idea how to implement this in xaml. I cannot force this to fill whole screen and when moving splitter then whole screen grows. Can anybody help? <UserControl xmlns:c...

CSS Problem, fixed contentarea with left and right sidebar?

Hey guys, i really need your help with a CSS-Layout. I tried a few time, however i've no chance (and actually no idea how) to solve it. Moreover I don't even know if it's possible the way I want it! The #mainContent should always be centered horizontally in the browserwindow. It should be 1024px in width and a 100% of the windowheight...

Simple example of <merge> and <include> usage in Android XML-layouts.

I'm curious about the <merge> and <include> tags in Android XML-layouts. I've read two tutorials, but haven't yet found a simple example usage. Would be happy if someone could provide such an example or give a pointer to one. ...

Firefox ignoring padding

I have this CSS code: #tweet-container{ width: 290px; height: 272px; border: 1px solid #CCC; color: #CCC; font-size: 28px; text-align: center; letter-spacing: -2px; min-height: 10px; display: table-cell; vertical-align: middle; padding: 15px; } But firefox doesn't seem to recognize the top and bottom padding. Safari and Ch...