How to arrange the components in swings

hi..
i hava a small problem with components, how to arrange components as i like .
Name : |____________________|
Number :|____________________| phone : |____________________|
Address : |____________________| <------ it is TextField ok.
Like this, how to do this one in swings. I want 10 Lables & 10 TextField .
I want Label Behind the Textfield as shown above
Message was edited by:
therathna
Message was edited by:
therathna

but gives error when resize the window frameIf you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • How to arrange the information in alphabetical order in a listbox?

    Can you guys help me out?
    How to arrange the information in alphabetical order in a listbox?
    *The information is taken from a text file using FileReader
    Thanks

    private void jbInit() throws Exception {
    // Get information for the text file
    File f1 = new File("Albums.txt");
    try {
    FileReader fr = new FileReader(f1);
    BufferedReader br = new BufferedReader(fr);
    //Use a loop to read
    for (String str = br.readLine();
    str != null;
    str = br.readLine())
    jListModel.addElement(str);
    //Closing the file
    fr.close();
    catch (Exception ex) {
    JOptionPane.showMessageDialog(this, "Error Retriving File", "error",
    JOptionPane.ERROR_MESSAGE);
    Can you explain to me how to use the Collection class? Above codes is getting the data from my text file and put it into my ListBox(jModelList)... So after inputting the text into it.. how do i arrange it using the Collection?
    Thanks

  • How to change the components in a visible JPanel?

    How to change the components in a visible JPanel?
    Is there any way to change the components in a JPanel while it is already visible in a JFrame? I tried the na�ve approach of removing the components and adding new ones, but the effect is not the expected.
    For now I'm opening new frames with newly created panels.

    After adding/removing components to/from a panel try:
    panel.revalidate();
    panel.repaint() // sometimes this is also needed, I'm
    not sure whyI'm not certain, but I think that panel.revalidate() implicitly calls repaint() only if something actually changed in the layout. If nothing changed, it sees no reason to repaint; hence, if something changed in appearance but not in layout, you have to repaint it yourself.
    Or something like that. I'm no expert. ;)

  • How to improve the Performance of Swing Components

    Hi
    I have developed a GUI Framework with Swing components. I observed that when number of components are more, the GUI is slow. Could anybody suggest me the ways to improve the performance of Swing Components
    Thanks

    Hi There - I haven't found issues so far with the speed of the GUI building, it seems fast when compared with .NET applications
    Are you doing any database querying on form load? This can slow down the loading of the GUI, I use persistence in an application and before the GUI is shown the persistence unit logs in to the database and registers itself - it does take 2/3 seconds to register and complete whatever it does before the form builds and shows
    Also check if you are loading/using any network based files on form load, this can also slow down the building considerably as well. Apart from that it's hard to say where your issue may lie apart from removing controls and checking build speed until you find the one that's slowing it down (not a good approach though) I sometimes had to load csv files from a network drive and if the file server is slow or LAN speed isn't great this can also cause a delay, hope you find it.....

  • How can I arrange the components in a better layout?

    Hi,
    I found that the layout manager is not enough for me to put things around, there's only some straight position like east, south, southeast, etc. Is there anyway I can put the component in a particular point? Thx.
    Adrian

    set the LayoutManager to null, by using setLayout(null). Then you can position the components at positions you want by using either component.setLocation(x, y), component.setSize(width, height) or component.setBounds(x, y, width, height).
    However, using this has a disadvantage, since if the Container is resized, the components will not adjust accordingly. Thus you may want to set the resizable property false for the container.
    ~Debopam

  • How to print the components in scrollpane

    hi there,
    can anyone tell me how to print the scrollpane components, i mean the headers & the main view of the component. i've a scrollpane with the following code and i want to print the components:
    JScrollPane pane = new JScrollPane(aTextPane);
    pane.setRowHeaderView(aLineNumberComponent);my requirement is i've a editor & lineno component as textpanes and added to scrollpane & when asked to print it should print the lineno component which resides in scrollpane's row header & the editor textpane which is the main view in the scrollpane. how can i achieve this?
    i'd would appreciate any suggestions & codes given.
    thanx in advance.

    After adding/removing components to/from a panel try:
    panel.revalidate();
    panel.repaint() // sometimes this is also needed, I'm
    not sure whyI'm not certain, but I think that panel.revalidate() implicitly calls repaint() only if something actually changed in the layout. If nothing changed, it sees no reason to repaint; hence, if something changed in appearance but not in layout, you have to repaint it yourself.
    Or something like that. I'm no expert. ;)

  • How to change the components of the planned order? (FM or BAPI)

    I need to change the storage(LGORT) in the components.
    I found only MD_PLDORD_CHANGE_COMP_ITEMS, but could not get the correct result.
    Has anyone used this FM to change the components of the planned order?
    Can you please tell how to use it. Or advise an alternative solution.

    Hi Anton,
    There's a BAPI to change planned orders - BAPI_PLANNEDORDER_CHANGE, but it allows to change only header data.
    Therefore you'll have to go a bit longer, and use a couple of other BAPIs:
    First read the order that you want to change - BAPI_PLANNEDORDER_GET_DETAIL
    Second, create a new planned order with the changed data, based on the read planned order - BAPI_PLANNEDORDER_CREATE.
    Third, delete the old planned order - BAPI_PLANNEDORDER_DELETE.
    Regards,
    Mario

  • How to resize the components in a JFrame when the JFrame Resizes?

    Hi all,
    i have some problems with my app. I have set the JFrame resizable and that works fine for the JFrame but not for the components in the JFrame.
    So my question is how can i set the components in a JFrame to resize automatically when the JFrame resizes?
    Here are the important things from my code,...if you need more, just let me know, its my first post in a forum .
    Its a JFrame with a JTabbedPane and on the Tabs are Panels with buttons and Tables.
    Thank you in advance!
    public class MainMonitor extends JFrame {
    public MainMonitor() {
              super();
              initialize();
              setVisible(true);
         private void initialize() {
              this.setSize(1145, 785);
              this.setIconImage(Toolkit.getDefaultToolkit().getImage("Images/c.gif"));
              this.setContentPane(getJContentPane());
              this.setTitle("Company Manager");
              this.setResizable(true);
              this.setLocationRelativeTo(null);
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.setOpaque(true);
                   jContentPane.add(getJTabbedPane(), null);
                   jContentPane.add(getJPanel11(), null);
              return jContentPane;
         private JTabbedPane getJTabbedPane() {
              if (jTabbedPane == null) {
                   jTabbedPane = new JTabbedPane();
                   jTabbedPane.setLocation(new Point(6, 69));
                   jTabbedPane.setSize(new Dimension(1120, 684));
                   jTabbedPane.addTab("P", null, getJPanel(), null);
                   jTabbedPane.addTab("K", null, getJPanel1(), null);
                   jTabbedPane.addTab("B", null, getJPanel2(), null);
              return jTabbedPane;
         

    Giasaste wrote:
    Thanks a lot, i didnt knew that the Layout Manager is a must.It's not a must, but it is the way to allow your app to be resized nicely and makes it much easier to maintain and enhance your program. Imagine creating a complex gui then later decide that you want another radiobutton and to remove a jlabel / jtextfield pair. with layout managers a chore becomes easy.

  • How are all the Components available in CCMS

    All,
    I am new to MI, I have one question: Once we register all the components in MCD, Are all these components required to be enabled/made available in CCMS? If so how will that be done?
    Regards
    Sudh

    Hi
    It is not necessary to make an entry of your components in CCMS. It is an optional configuration unless you want to be alerted on some updates. These steps will be defined clearly in your configuration docs.
    regards
    Arun

  • Subcontracting - How to plan the components in MRP

    Hi Experts,
    We have the following  requirement to map the subcontracting scenario in SAP MM.
    1) Subcontracting PR has to be generated during MRP run for all the FERT materials ( Done )
    2) Auto convertion of PR into PO by scheduling the batch job ( Done )
    3) Goods issue with subcon delivery ( done )
    4) Pick list from subcon delivery ( possible)
    My question here is How to create the delivery schedule lines for components thru MRP and made available to the subcontractor in the required date.Client does not want to maintain the inventory for even 1 week.
    Example :
    FG required date 7.01.2009
    PO release date 30.12.2008
    Component level A Requirement date 29.12.2008 ( How we can control in MRP)
    Component Level B Requirment date 03.01.2009 ( How we can control in MRP)
    Appreciate your reply.
    Thanks / Karthik

    Hi
    Thanks for your reply.
    Let me brief about the process.
    Client wants to consign the components at subcontractor's place and will be considered as a separate plant.So the subcontractor will manage the component stock which is supplied by third party vendor directly to the subcontractors place. so there will not be any frieght cost issue.
    But the client requirement is not to spend more money on  component inventory so when the level 1 components are required the system should generate the delivery scedule with required dates.
    1) Component A is reqd to manufacture the HALB assemply at level 1
    2) Component B & HALB to manufacture the Finished Goods at level 2
    My requirement during MRP run
    1) PR for FG
    2) Delivery Scedule for Component A with reqd date
    3) Delivery scedule for component B with reqd date
    Can I make HALB as phantom BOM???
    or Suggest me how I can do other way round..
    Thanks / karthik

  • How to see the components of OTHERS

    how do we know the components of "others" in the storage?

    The Storage Display
    Where did my Disk Space go?

  • How to minimize the components

    Hi,
          when ever I minimizing the window,the components in that windows are not displaying properly.
          I am using jdev 11.1.2.3
         How to  properly render the components?
         Can any one please give me the answer?

    hi "18a5907a-dc24-4e16-bea6-51d7905449e8"
    18a5907a-dc24-4e16-bea6-51d7905449e8 wrote:
    ... when ever I minimizing the window ...
    Should a minimized browser window really still display something? Do you mean a re-sized browser window?
    18a5907a-dc24-4e16-bea6-51d7905449e8 wrote:
    ... the components in that windows are not displaying properly ...
    Which components? Which layout components? What is "properly", what do you expect?
    18a5907a-dc24-4e16-bea6-51d7905449e8 wrote:
    ... Can any one please give me the answer?
    So, please provide more information if you expect a useful answer.
    (tip : You can use "Edit profile & privacy" to make your name visible in forum posts.)
    success
    Jan Vervecken

  • How to import the components onto the portal

    Dear All,
    I've got installed ECC6 in my home PC with some of the netweaver components like XI, BI and etc. But after login into the Portal, I'm not finding any of the components on the portal, except the welcome screen. And ABAP is working well from the SAP logon pad.
    So can anyone explain that, how to import the netweaver components onto the portal. Pl. give me the step-by-step explanation as i'm very new to this aspect.
    Best Regards
    Mahesh

    See this -> iTunes for Windows: Optical drive is no longer recognized, or "Disc burner or software not found" alert after install
    and this -> iTunes for Windows: Troubleshooting CD issues caused by device filters

  • How to better the performance while Swing??(urgent)

    Hi all,
    I am working on a product where there are many applets embedded within the JSPs.So each time when the user go out and again come back to the page,the applets are getting loaded after taking a lot of time(almost 30-40secs).Do please note that all these applets contain a lot of UI controls which would be populted by the user.
    Please tell me how to improve the performance of these applets by holding the data once entered by the user.
    thnx & rgds,
    balan_v

    hi,
    One way is to use jar files, Once the jar files are installed on the client machine they dont need to be downloaded every time.

  • How canI call the socket by swing? I have asocket code already

    Socket sock=new Socket("localhost",Integer.parseInt(args[1]));
                DataInputStream input = new DataInputStream(sock.getInputStream());
                DataOutputStream output=new DataOutputStream(sock.getOutputStream());
                PrintStream command = new PrintStream(sock.getOutputStream());
                BufferedReader buffer= new BufferedReader(new InputStreamReader(sock.getInputStream()));
                String userInput="GO 100";
                int size=userInput.length();
                 byte[] asciiBytes = userInput.getBytes("US-ASCII");
                 int sum=0;
                 for(int i=0;i<size;i++){
                     int j=asciiBytes;
    sum=sum+j;
    command.print(userInput+" "+sum);
    System.out.print(buffer.readLine());
    that onefor socket but I have GUI button to submit the ip. How can I call socket because on GUI we don't have throw IOException here is the main I just want after submit. My program take args[1] into the ip and call server. How can I do that?
        public static void main(String args[]) throws IOException{
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new client_gui().setVisible(true);

    Swing has nothing to do with a Socket connection.
    Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]Custom Networking for examples of using a Socket.

Maybe you are looking for

  • Setting up a business website for self and others

    Hi, I'm looking for information regarding using adobe muse to setup a website for an online store. Specifically, using it to setup a website for a friend or loved one. My girlfriend is starting up a jewellery business and needs a website to sell her

  • Any improvements to new 3G audio speaker , also comments on yellow screens?

    Hello all you new 3G owners, can anyone comment on the "New improved audio quality" as mentione by Steve Jobs? Has the speaker phone volume improved and can you hear the ring tones? Also a few people are commenting on yellowish tint to their screens,

  • Why can't I import video and photo media, that in my Music and My photos

    I'm pretty new to Mac machines but I've been trying to create a dvd of the current video content I have which was recently imported from my now broken PC, however when I attempt to import any media the items are all greyed out and won't be accepted t

  • MS Project 2010 Start dates change automatically

    Hi, I hope someone can help with this project problem, its driving me insane! I have a set of activities which have a start date of 01/09/2014, there are no predecessors to these tasks but there are successors, and a date constraint date (the project

  • BMC Password default

    I have a Lenovo server RD330. I have set up a port to use the BMC. What is the default password for this. I asume the user is admin what is the default password. Thanks. Solved! Go to Solution.