layout

Controlling the preferred size of a JEditorPane with long text

I have a JEditorPane which is displayed inside a popup, triggered through a button. The pane contains long text, therefore it's nested inside a JScrollPane, and the popup is constrained to a maximal size of 300 x 100: public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override publi...

How to get the absolute coordinates of a view

Hi, I'm trying to get the absolute screen pixel coordinates of the top left corner of a view. However, all methods I can find such as getLeft() and getRight() don't work as they all seem to be relative to the parent of the view, thus giving me 0. What is the proper way to do this? If it helps, this is for a 'put the picture back in ord...

How to you transform these image togglebuttons into vector togglebuttons?

Hello, I have just implemented these ToggleButtons using ControlTemplates that set the Image content according to IsChecked stated. The images are made in Photoshop, but I want them as WPF vectors. The buttons look like these when IsChecked=False: And when IsChecked=True I just replace the Image with another PNG: I've designed th...

Layout of pages - absolute positioning

Afternoon all - I'm after a bit of advice really. Being a newbie, I now realise that the method I employed to design my first project is a bit crap. Having little/no knowledge of anything to do with web development, I went down the route of placing my controls on a page with absolute positioning...I just liked the idea of dragging and d...

Problem in generating label controls in Windows formsApplication

Hi, I have created pictureboxes dynamically in windows forms Application... its working well... now i have to generate label boxes dynamically and that label boxes will display in bottom of the each picture box and that have to display the corressponding picturebox name... how shall i do this? Give me the solution of this... Thanks In A...

who (NOT WHY) should have the final say on the layout/design of a website that is developed in-house?

forget the weird cases/companies, but in general, who, in your view, is the person who should be able to put his/her foot down and say "THIS is the layout. THIS is where the marketing message comes, THIS is where the price comes, THIS is where the testimonial comes"?? - the boss man, the template designer, users (split testing or somethi...

Paradigms in menu bar layout/design

Doing some restructuring on the my applications menu bar. When looking at other applications, there seems to be two different ways of structure. Either the "old school" most common way, the verb/command followed by the subject. I.e. what do you want to do and what do you want to do that on. Like so: File New Foo Bar Open Foo Bar ...

Help for basic Android view for a Next/Prev navigation like E-mail setup

I am after the XML view code, just like the E-mail setup. How can I put on that bottom grey bar that Next button, how about a Prev button on left side? ...

What is the correct way to specify dimensions in DIP from Java code ?

I found that it is possible to set dimensions of my interface elements in XML layouts using DIPs as in following fragment : "android:layout_width="10dip" But all Java interface takes integer as arguments and there is no way to specify dimensions in DIPs. What is the correct way to calculate this? I figured that I have to use property...

How can I set a JPanel maximum or preferred size that uses gridLayout?

Hi guys, I had problem using a very simple frame containing two JPanel. The problem is on the layout of the Center JPanel that contains four JButton. How can I set a better size for buttons or directly for JPanel that uses the GridLayout. On the picture the problem: ! Here the code: ` JFrame window = new JFrame("Horrible! LOL"); ...

Location on screen of location in NSTextView

Hi, I want to get the screen location (NSPoint) of a point in an NSTextView, this should be simple, but by results are always a bit off, the X is perfect, but the Y seems to vary. I've tried a few variations of the code below, but can't get the result I'm after, is the NSClipView screwing it up? NSPoint p = [[self layoutManager] locat...

How to generate a polygon number figure using metapost?

I'm learning metapost and i want to know how to generate a figure like a polygon number http://en.wikipedia.org/wiki/Polygonal_number , i got triangular numbers but not hexagonal. Thanks for help. ...

MSVC Object Layout Quirk

I have a simple class in C++ that has an integer and a vtable: class Something { virtual void sampleVirtualMethod(); int someInteger; }; If you look at the object layout for MSVC (using the /d1reportSingleClassLayout) you get: class Something size(8): +--- 0 | {vfptr} 4 | someInteger +--- W...

CSS div is not visible

With this css .addProblemClass{ width:300px; height:300px; border:solid 1px #000000; background-color:#FFFFFF; opacity:0.9;/*For chrome and mozilla*/ filter:alpha(opacity=90);/*For IE*/ } .boxHeader{ border: solid 1px #000000; height: 15%; } .addProblemHeaderTextDiv{ border:solid 1px #FF0000; ma...

Nonstandard floating layout - grow then stop

Here is the sample pseudo XAML code <Window> <Grid Rows="2"> <Listbox Row="0"/> <Button Row="1"/> </Grid> </Window> Grid doesn't work here, just for example Listbox is databinded and can have multiple items Button is placed under the ListBox - immediately under, not on bottom of window Listbox can grow, mov...

GEF java draw2d Layout that adjusts to the width of the container so that it spans over more lines

I need to show a line/multiline of images in GEF GraphicalViewer, so that it adjusts to the width of the container by spanning over more lines ...

swing: appropriate layout manager for simple situation?

I have a JPanel that I want to use to contain 3 vertical components: a JLabel a JTextField a JScrollPane I want all 3 components to fill the JPanel's width. I want the JLabel and JTextField to use their normal heights and the JScrollPane to use the rest. BoxLayout almost works, except it seems like the JTextField and JScrollPane sha...

Custom scroll bar visualization with HTML/CSS/JavaScript

I am creating a highly specialized application where I want to experiment with a custom scroll bar. Ideally, I'd disable the built-in scroll-bar and draw my own. The page would look and feel like any other page, just that the scroll bar wouldn't be visible. The arrow keys, the scroll wheel, and any other mean of scrolling the page, shou...

android developer question

I am looking the R.java file and I saw this under the app_name 0x7f040001. I know that is some kind of encryption because it displays hello world i believe. There are other ones there but I was just wonder what encryption that is. Thanks for any help ...

Aligning text box in cell if table?

i want to align text box to right in cell of table. it is working in firefox but in internet explorer text box is coming somewhat downwards i.e. it is not coming as perfect as in firefox. <tr> <td id="searchRow"> <img id="imag"><a href="adminLogin.php" >Admin Login</a> <div style="float: right;text-align: right;">Sea...