How to set the size for the content pane?

* Login.java
* Created on 15 March 2004, 17:17
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
* @author Mindwalker
public class Login extends javax.swing.JFrame implements ActionListener {
     private JFrame controllingFrame;
private JPasswordField passwordField;
private static String Login = "Login";
/** Creates new form Login */
public Login() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
private void initComponents() {//GEN-BEGIN:initComponents
PasswordEnter = new javax.swing.JTextField();
User_name = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
getContentPane().setLayout(null);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
getContentPane().add(PasswordEnter);
PasswordEnter.setBounds(150, 160, 140, 20);
getContentPane().add(User_name);
User_name.setBounds(150, 120, 140, 20);
jLabel1.setText("Password");
getContentPane().add(jLabel1);
jLabel1.setBounds(40, 160, 70, 16);
jLabel2.setText("User name");
getContentPane().add(jLabel2);
jLabel2.setBounds(40, 120, 80, 16);
jButton1.setText("Login");
getContentPane().add(jButton1);
jButton1.setBounds(170, 210, 81, 26);
jButton1.addActionListener(this);
pack();     

You don't learn anything by using GUI building tools. You learn by reading. Here's a section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html]Using Layout Managers that also deals with "Absolute Positioning".

Similar Messages

  • How to set minimum size for the 'location' box in toolbars?

    I reorganized my toolbars by merging the location and tabs bar. I have the location on the left hand side and the tabs *next* to it, like this:
    [ (<)(>) [LOCATION] /tab\/tab\/tab\ ]
    Unfortunately when the number of tabs increases, the location box becomes so small that I cannot even see the url of the site I'm in...
    Is there a way to force a minimum width for the location box? I couldn't find a setting in about:config for it (I imagine that this would be a browser.urlbar setting)

    You rock! The combination of fixed width tabs with the stylish Add-on, and the single line of script below just made my day!
    #main-window[sizemode="maximized"] #TabsToolbar, #TabsToolbar > #urlbar-container { min-width: 350px; }
    Many thanks!

  • How to set percentage size for layout? for example : VBox,HBox,AnchorPane,.

    how to set percentage size for layout? for example : VBox,HBox,AnchorPane,......
    like HTML
    &lt;div width=&quot;640px&quot; height=&quot;480px&quot;&gt;
    &lt;div widht=&quot;50%&quot; height=&quot;60%&quot;/&gt;
    &lt;div widht=&quot;30%&quot; height=&quot;60%&quot;/&gt;
    &lt;div widht=&quot;20%&quot; height=&quot;60%&quot;/&gt;
    &lt;/div&gt;
    -----

    This is not supported. You can file a feature request at http://javafx-jira.kenai.com

  • How to set default size for .chm window?

    I know there is an answer at grainge.org, but it seems to be
    referring only to a .chm using skins, which I am not.
    Anybody know how to make the default size of the .chm larger?
    thanks, Leisa

    Lacona,
    The default window size is set in your windows properties
    dialog in RoboHelp. It can also be set manually in the .hhp file
    before you compile. If you open the .hhp file in a text editor,
    such as Notepad, you will see a [WINDOWS] section and for each
    window defined there will be a series of numbers. One of these is a
    vector [in square brackets] that defines the original position.
    These are absolute screen pixels.
    In older versions of RoboHelp, one of which I use, there was
    a limit to the size of the window RH would allow but when I changed
    the .hhp, RoboHelp didn't try to overwrite it unless I reopened the
    Windows properties dialog. I'm not sure how the latest versions
    handle this but you might try editing the .hhp with Notepad and
    then compiling the .chm.
    John

  • How to set output size for mp4?

    Hello,
    I'm having a problem with the export of a Captivate video tutorial.
    The output size is w 1440 x h 900 pixels. It comes out looking fine, but as soon as we put it through any other transcoding process as required by our own workflows, the image quality deteriorates.
    Now, I've read in this forum that any alteration of the size of the image will cause this deterioration in quality. Effectively, the dimensions of the transcoded output from our own video editors are much smaller than those of the input mp4.
    However, we would like to keep that smaller size because it makes for better performances in video streaming.
    Is there any way in Captivate to set the dimensions for the mp4 output to be smaller? The 1440 x 900 dimensions are already different from the capture area (the whole screen), so it seems they are independent from the capture settings.
    Thanks to anyone who can help.
    Elisa Roselli
    Technical Documentation Manager
    Cambridge Imaging Systems

    Apple no longer supports Safari for Windows  >  Apple apparently kills Windows PC support
    Use either IE or Chrome.

  • How to set PDF version for the output file in ES4

    I am using LiveCycle ES4 for converting word docs to PDF. In our client we invoke createPDF method of GeneratePdfServiceClient class. We are using a custom PDF setting in LiveCycle in which we have defined configuration as per the business requirement.
    We need the PDF version of the document to be set to 1.4.  For this, we are setting the value for compatibility (under File Option) to Acrobat 5 (PDF 1.4) in custom PDF setting template in LiveCycle adminui and in Acrobat preferences. Both these setting are not working and the resulting document has PDF version set to PDF1.5. Can you tell me how the version of resulting document be set to 1.4??

    Hi Neelam,
    I tried it and did the personalization as the help documentation said.
    But I don't know why it doesn't work:(
    I followed these steps:
    1. open workbook and select a value for the variable used in query
    2.click personalized variable and new window pop up then I select the value I chose and added to the selection.
    3.click ok and quit
    4.save workbook
    but next time I open this workbook, the variable selection window still pop up.
    BR
    Fanchest

  • How to set a 'package' for the xjc generated files?

    Hi!
    What can be done the let the 'xjc' source generator
    create a 'package' line for each generated java file?
    Karl

    Can I generate the classes from the same xjs file to different packages ?
    For example:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xml-java-binding-schema version="1.0-ea">
         <options package="try.billing.data"/>
         <element name="downloadUnbilledCallsContent" type="class" root="true">
              <content>
                   <element-ref name="accountId"/>
                   <element-ref name="email"/>
              </content>
              <attribute name="dataObject"/>
              <attribute name="handlerClass"/>
         </element>
         <options package="try.util.data"/>
         <interface     name="JavaSources"
                   members="DownloadUnbilledCallsContent"
                   properties="dataObject email"/>
    </xml-java-binding-schema>
    The interface JavaSources has to be in try.util.data package but the downloadUnbilledCallsContent class has to be in try.billing.data.
    thanks

  • Setting default size for the information area in the main window

    Hi, I wonder if there is any way to change the default size of the information area in the main window (lower left corner). I want it a little bigger because I had some useful information set there and I had to change the size every time I log in.
    Thanks in advance.

    That part of the interface doesn't have an exposed preference to control.
    One thing you could do is reorder your metadata fields within the info pane so the most important are listed first and always visible.

  • How to set new value for the existing jar file

    Help:
    I am wondering if there is a simple to update value for Manifest-Version in a existing jar file?
    Thanks!

    The jar command's -u option is about as easy as I know.
    See the jar command documentation for the details.

  • How to set image size for importing photos from a digital camera

    I'm using Iphoto 6 and am a novice user of my new digital camera. The camera is set to HQ image quality. Initially when I imported photos from the camera into IPhoto, the images were very large (over 1 meg) and produced good quality 4X6 prints. Now when I import photos from the same camera still set to HQ image quality, the photos are very small (less than 100 kb) after being imported into IPhoto. I think I must have changed some kind of setting in IPhoto that affects the size of an imported image, but I can't find where that is or how to change it back so that the size is not changed when imported. Can someone please help me with this? Thanks!
    IMAC G5   Mac OS X (10.3.9)   my other computer is a Dell Dimension L500CX running Windows XP Pro

    Dave, thanks for clarifying Toad's response for me - I was just too ignorant to connect the dots from his responses. As you said, there were 2 versions - 1 in the original folder and 1 in data; the original folder had the photos that were 1 mb. We must have pulled from that folder previously to print photos not realizing they existed in 2 places. So when we found these thumbnail photos, we just thought they were the real thing. Where can you go to learn about the struction and hierarchy of the photos in terms of what Iphoto does to an image when you import it? Is it in Iphoto help somewhere? Thanks so much for your help with this, and you too Toad for leading me down the path.
    If you're getting the size from Finder, I think Old
    Toad's question makes a lot of sense. Is the file
    you're looking at, somewhere in a folder called
    "Data" in iPhoto Library? That 56k sounds about the
    right size for a thumbnail.
    If you do a search for the image name, both the
    actual photo and the small thumbnail are stored with
    the same image, e.g. abc.jpg
    IMAC G5   Mac OS X (10.3.9)   my other computer is a Dell Dimension L500CX running Windows XP Pro

  • How to set a hover for Accordion content?

    Hello,
    I'm trying to figure out how to make a vertical side navigation using the accordion feature.
    I've got it all working for what I want to do except for a hover on content.
    I have it set for hover on the labels so it shows the blue bar and yellow text on hover or open like I want.
    What I'd like now is to have a background on each content line when I hover on it (and when selected it stays the background shown on hover).
    I've got a background image for the yellow gradient highlight shown below, but can't figure out how to set the Content for hover like I did the Top Level Tab.
    I'm attaching a couple of files for demonstration in case the above is not clear.
    thanks!
    kim

    Use the css :hover..
    http://www.daniweb.com/forums/thread109916.html#

  • How to set default size for published SWF in Catalyst CS5.5

    I create a 800*600 pixel project in Catalyst CS5.5 and published it as .swf.
    But when I opened the published .swf, the default size is smaller than 800*600. I have to resize it by myself.
    So is there any method that I can set the default size for published .swf?
    Thank you guys! Best regards.
    Nick

    When you start new Flash Catalyst project, you have the option to enable resizing
    This setting is enabled by default.
    If you need to change this later, you can go into Modify > Artboard settings.
    Now when you publish your project, the width and height will be used instead.
    As to manually editting the HTML file, there are 3 tag sets that define the width and height of the project (to handle various browsers). You will need to adjust the values in each of those tag sets. You should only need to do this if you can't republish the file.
    Chris

  • How to set minimum size for PieChart wedge?

    The following chart has one wedge that is very thin. I know it is because the data value for that wedge is very small (262) compared to the other wedge data values, but I'd like to be able to set a minimum wedge size.
    Any ideas?
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script><![CDATA[
         import mx.collections.ArrayCollection;
         [Bindable]
         public var expenses:ArrayCollection = new ArrayCollection([
            {Expense:"Jan", Amount:2200000},
            {Expense:"Feb", Amount:4700000},
            {Expense:"Mar", Amount:2300000},
            {Expense:"Jul", Amount:262}
      ]]></mx:Script>
      <mx:Panel title="Pie Chart">
         <mx:PieChart id="myChart"
            dataProvider="{expenses}"
            showDataTips="true"
         >
            <mx:series>
               <mx:PieSeries
                    field="Amount"
                    nameField="Expense"
                    labelPosition="callout"
               />
            </mx:series>
         </mx:PieChart>
      </mx:Panel>
    </mx:Application>

    This might be close enough to what you're looking for:
    The FB 4 code is shown below:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        minWidth="955" minHeight="600">
        <fx:Script>
         <![CDATA[
            import mx.charts.HitData;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.utils.ObjectUtil;
            [Bindable] private var Amount:String = "";
            [Bindable] private var minAmount:String = "";
            [Bindable]
            public var expenses:ArrayCollection = new ArrayCollection([
            {Expense:"Jan", Amount:2200000, minAmount:2200000},
            {Expense:"Feb", Amount:4700000, minAmount:4700000},
            {Expense:"Mar", Amount:2300000, minAmount:2300000},
            {Expense:"Jul", Amount:262, minAmount:50000}
            private function getDataTips(hitData:HitData):String {
                // add percent when the user gets the DataTip
                var percentValue:Number = (hitData.item.Amount / 9200262) * 100;
                var f:int = 3;
                if (percentValue > 1) {
                    f = 1;
                return hitData.item.Expense + ": " + percentValue.toFixed(f) + " % (" + hitData.item.Amount + ")";
            private function getData(series:PieSeries, item:Object, fieldName:String):Object {
                if (item.minAmount != 50000) {
                    return item.Amount;
                    psExpenses.setStyle("labelPosition", "callout");
                } else {
                    return item.minAmount
                    psExpenses.setStyle("labelPosition", "none");
         ]]>
        </fx:Script>
        <mx:Panel title="Pie Chart">
         <mx:PieChart id="myChart"
                 dataProvider="{expenses}" dataTipFunction="getDataTips"
                 showDataTips="true">
            <mx:series>
                <mx:PieSeries id="psExpenses" nameField="Expense" dataFunction="getData"/>
            </mx:series>
         </mx:PieChart>
        </mx:Panel>
    </s:Application>

  • How to set fixed size for inputfile text field

    Hi all,
    I am using inputfile component to test file uploading so I created a simple upload page. When I finished upload the file, the input text field will "shrink" its size and change the size to adjust the file name. Is there any way to set a fix size for input text field?
    Here is some part of the code:
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1">
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>
    FileBean:
    public void fileUpdate(ValueChangeEvent valueChangeEvent) {
    RichInputFile inputFileComponent = (RichInputFile)valueChangeEvent.getComponent();
    UploadedFile newFile = (UploadedFile)valueChangeEvent.getNewValue();
    UploadedFile oldFile = (UploadedFile)valueChangeEvent.getOldValue();
    Thanks,
    Jerry

    you can set columns attribute in af:inputfile. Please see highlighted area i have inserted to you code
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1" columns = "34" >
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>

  • How to set memory size for JRE

    hi all,
    Is there anyone know how to set the JRE memory size?
    My run my applet application onto browser and I want to increase to size of memory. Such as -ms 128m -mx256m.
    please help.
    regards,
    elvis

    The suggestion could be convert applet into WebStart application which is quite similar to applet (at least
    it is distributed similar way, resides within sandbox etc) but allows to specify memory size as you requested.

  • How to set fixed size for JTextField?????????

    you can create a textfield like
    JTextField text=new JTextField(8);
    here the constructor takes 8 as the width of textfield , not the size,
    if you type more the 8 characters, it takes it happily,
    i need that it only takes 8 characters, not more then that,
    after 8 character, the cursor should not move forward,
    can anybody help me???/

    Have a look at the following thread for an explanation:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=101704

Maybe you are looking for