How do display array of labels and buttons in JSplitPane

Helloo
Iam doing doing project on swing. I want to display an array of JLabels in JSplitPane. That to the leftside of the JSplitPane. On Right side Array of Jutton Please can any body solve my problem.
regards
sonali

Hi Sonali,
If u wish to add JLabel and JButton in the following manner
label
label
label
label
why not try using GridLayout for each of the panel in the splitpane.try setting gridLayout(0,10) assuming that u have 10 labels.Then add those to the panel which is added to the SplitPane.
Hope this gives u an idea.
Cheers :)
Nagaraj

Similar Messages

  • Gui labels and buttons not showing...

    I am using Java to create a gui and so far I have everything working.
    But there is a section of code thats not working out and Ill post the whole file here (not very big) to let you guys see whats going on. The issue lies in the action listner where I state "if a text feild is empty, display the option pane, else show the following" and its not showing the labels and buttons.
    Help?
    package student.information.search;
    import javax.swing.JFrame;
    import java.awt.GridBagLayout;
    import javax.swing.WindowConstants;
    import java.awt.Rectangle;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import java.awt.ActiveEvent;
    import java.awt.Frame;
    import java.awt.GridBagConstraints;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JTextField;
    import javax.swing.JButton;
    import student.information.readonly.ReadOnlyStudentForm;
    public class StudentSearch extends Frame implements ActionListener
       JTextField textField = new JTextField();
       JFrame frame = new JFrame();
       JPanel contentPane = (JPanel) frame.getContentPane();
       GridBagLayout gridBagLayout = new GridBagLayout();
        public StudentSearch()
            gridBagLayout.columnWidths = new int[]{20, 0, 12, 137, 17};
            gridBagLayout.rowHeights = new int[]{26, 0, 6, 0, 20};
            gridBagLayout.columnWeights = new double[]{1, 0, 0, 0, 0};
            gridBagLayout.rowWeights = new double[]{0, 0, 0, 0, 1};
            contentPane.setLayout(gridBagLayout);
            JButton button = new JButton();
            button.setText("Search");
            button.addActionListener(this);
            contentPane.add(button, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
            textField.setColumns(8);
            contentPane.add(textField, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, 768, 2, new Insets(0, 0, 0, 0), 0, 0));
            JLabel label = new JLabel();
            label.setText("Student Seach");
            contentPane.add(label, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, 256, 0, new Insets(0, 0, 0, 0), 0, 0));
            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            frame.setTitle("Student Search");
            frame.setBounds(new Rectangle(500, 0, 500, 320));
            frame.setVisible(true);
       public void actionPerformed( ActionEvent arg0)
            if (textField.getText().equals(""))
              JOptionPane.showConfirmDialog(null, "Please enter a value in the search feild", "Error", JOptionPane.OK_CANCEL_OPTION); 
            else
               //Show the text fields here and the user information. 
                 *  While there are students for this search, change the text fields to Name, Last Name and ID and have a button called
                 *  View that when clicked allows for you to view all that students information.
                JLabel firstName = new JLabel();
                firstName.setText("Label");
                contentPane.add(firstName, new GridBagConstraints(5, 5, 1, 1, 0.0, 0.0, 768, 0, new Insets(0, 0, 0, 0), 0, 0));
                JLabel lastName = new JLabel();
                lastName.setText("Label");
                contentPane.add(lastName, new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0, 256, 0, new Insets(0, 0, 0, 0), 0, 0));
                JLabel studentID = new JLabel();
                studentID.setText("Label");
                contentPane.add(studentID, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, 256, 0, new Insets(0, 0, 0, 0), 0, 0));
                JButton viewStudentInformation = new JButton();
                viewStudentInformation.setText("Search");
                viewStudentInformation.addActionListener(new ActionListener()
                        public void actionPerformed(ActionEvent e)
                               //For viewing individual student information
                                new ReadOnlyStudentForm();
                contentPane.add(viewStudentInformation, new GridBagConstraints(7, 3, 1, 1, 0.0, 0.0, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
    }

    In general when adding or removing components for a visible GUI you need to use:
    panel.add(...);
    panel.revalidate();
    panel.repaint();

  • How to display planned movement date and actual movement date together?

    Hi, Professionals,
    My purpose is to list delayed outbound deliveries.
    Anyone could tell me how to display planned movement date and actual movement date?
    Appreciate your help.

    Thanks Shiva.
    I tried another way to do it. It works only for a short period of time.
    By using VL06O, I list all outbound deliveries by limiting both planned goods movement dates and actual goods movements dates to the same week I would like to inspect. Say both from 7th/11 to 14th/11.
    then I list outbound delivery list with planned goods movement date to 7th/11 but left out actual goods movements dates this time.
    In excel, I compare those two lists and filter out those unique ones because those unique documents means delayed deliveries which cannot delivery according to planned date.
    However, the "delayed" list generated by this method has some noises. Not all of documents are really delayed although most of them do.
    I'm also looking for a way to list sales documents number of these delayed delivery documents so i can retrieve order details from it such as order value.
    Help still needed.

  • Label and Button in VBox, how to dynamically insert something between them?

    I'm probably missing something simple here, but scratching my head. If I have a VBox with a label and a button in it, is there no way to insert a new child between the other two children ? Something like a way to get at "nth child"? or "insertAtIndex" ? Most likely I am just thinking about this wrong-headedly. Thanks.

    ah, so .add() takes an int which determines the position among the children in which it will be inserted? I knew I was completely missing something critically simple. Thank you.

  • How to display the Data labels in Chartobject Dynamically?

    Hi
    i am using Crystal Report Server XI R2 -  ReportClientDocument to generate reports dynamically.
    i want to display the data labels on the chart object in runtime. how it is possible?
    is there any way to achieve this? since it is possible in designer, i hope that there must be WAY.....
    Regards,
    Padmanaban V

    The chart analyzer is a third party tool that Crystal is licensed to use in the designer. That means in the Crystal Designer you have a lot of chart functionality, but at runtime the chart exists as part of the report object and the analyzer is not present. Therefore you have a few formatting options but not as many as in the designer.
    For details of what options you have with the chart at runtime, see these links:
    [1|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/CrystalReports_dotNET_SDK/crsdk_net_doc/doc/crsdk_net_doc/html/crlrfCrystalDecisionsCrystalReportsEngineChartObject_MembersTopic.htm]
    [2|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/CrystalReports_dotNET_SDK/crsdk_net_doc/doc/crsdk_net_doc/html/crlrfCrystalDecisionsCrystalReportsEngineChartObject_PropertiesTopic.htm]
    [3|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/CrystalReports_dotNET_SDK/crsdk_net_doc/doc/crsdk_net_doc/html/crlrfCrystalDecisionsCrystalReportsEngineChartObjectClassTopic.htm]
    Ludek

  • How to display array values in jsp of screen flows

    Hi,
    can u please help me .
    I am having one array variable i have stored all the values but i have to display that in JSP page .how to display
    Edited by: user12171025 on Nov 4, 2009 11:11 PM

    Hi,
    I think that its necessaries to use AJaX.
    I am implemeting something like that.
    I have a input text that works like a filter and depends on what my user types in input text I populate my table with some information.
    In order to do that, I put in my JSP a div with an Id and I used ajax, like that:
    function ajaxFunction()
              var xmlhttp;
              if (window.XMLHttpRequest)
              xmlhttp=new XMLHttpRequest();
              else if (window.ActiveXObject)
              // code for IE6, IE5
              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              else
              alert("Your browser does not support XMLHTTP!");
              xmlhttp.onreadystatechange=function()
                                                      if( xmlhttp.readyState==4 )
                                                           document.getElementById("tabelaResponsaveis").innerHTML = xmlhttp.responseText;
         var resp = "<f:invokeUrl var='solicitacao' methodName='getResponsaveis'/>";
         xmlhttp.open("POST",resp,true);
         xmlhttp.send(null);
    getResponsaveis is a method inside my BPM that returns a HTML code (the table HTML code with all the information that I need to show.
    I Hope to help
    Thanks Marcos

  • How to display a fixed min and open max Y axis scale on obiee 11g

    Hi,
    I am stuck with an issue.
    Obiee by default is plotting my bar chart with Y axis scale from -50 to 850 with and interval of 100.
    In the graph non of the value is negative of below zero. The graph too plots all the points above 0, even then it starts the Y scale from -50, not sure why?
    I wanted to know whether we can by anyway limit the y axis scale with lower limit to 0 and still keep the upper limit open or undefined.
    Please let me know if any of you have come across such scenarios?
    Thanks

    > I want to plot log(log(y)) vs x. On the y-axis of the graph I need to
    > display 'y', NOT log(y) or log(log(y)). How do I adjust the scale to
    > allow for this?
    >
    > {I do realize that I can plot log(y) vs x and display 'y' by using the
    > Logarithmic scale option.}
    Not being that familiar with the typical labeling on log(log) plots, you
    may be able to do this using two scales. Make a graph that contains two
    scales. One will be plotted against, the other will be just for labeling.
    You can now transform your diagram data, which will change how the mapped
    scale is labeled, but the other scale can show whatever you like in linear
    or log form.
    In otherwords, on the diagram, perform log10 on your data, then display on
    a log scale that is hidden. Make another scale vi
    sible with linear or log
    data. Or perform log10(log10) on your data, display on a hidden linear
    scale.
    I'm not sure how well this will work. If it is insufficient, you can submit
    a feature request on the web site.
    Greg McKaskle

  • How to display the content once the button is clicked

    Hello!  Just joined today, and my apologize for my huge noobness.
    I'm still learning how to use Flash... and am still struggling on one thing.  It may seem simple to the most of you -- how exactly do you have the content displayed once you click the button?  I'm attempting to have the content for each navigation link button to show up each time it's clicked.  Still a failure.
    Thank you in advance!

    The four frames of a button are related to the button's interactivity and have nothing to do with using the button to display anything beyond itself.   The first three frames ((Up, Over, Down) are used to depict how the button appears for the three possible states of interaction (None, Hover, Press). The "Hit" frame of a button is used to define the interactive area of a button but does nothig as far as contributing to the visual elements of the button.
    As far as getting step-by-step instruction goes, you should try visiting a site like Lynda.com to get some training in using Flash.  You can also try searching Google to find tutorials that others have already written.

  • How to display application server date and time?

    Hi Friends,
                    I am getting error when i am trying to display default date,time and client.
    I have designed a screen where DATE, TIME and CLIENT are 3 fields in the screen this 3 fields i have to display defaultly date,time and client of the application server.
    In the data declarations i have declared like...
    DATA: DATE LIKE SY-DATUM,
               TIME LIKE SY-UZEIT,
              CLIENT LIKE SY-MANDT.
    In the PBO screen source code i am writeing like...
    write: 'DATE', SY-DATUM, / 'TIME', SY-UZEIT, / 'CLIENT', SY-MANDT.
    But i am not able to display the output please can anyone point my mistake where i am going useful will be rewarded.
    Thks

    Hi Reddy,
    I will tell u how to get this done .
    Check all these screen shots .No work at all .
    [Screen shot 1|http://bp3.blogger.com/_O5f8iAlgdNQ/R-icwCm1qvI/AAAAAAAAA9k/7gshn3AKOZ0/s1600-h/date1-715845.jpg]
    [Screen shot 2.|http://bp1.blogger.com/_O5f8iAlgdNQ/R-icwim1qwI/AAAAAAAAA9s/QMtdiWyB-nY/s1600-h/date2-718517.jpg]
    [Screen shot 3|http://bp2.blogger.com/_O5f8iAlgdNQ/R-icwym1qxI/AAAAAAAAA90/4GnH-bwAPEo/s1600-h/date3-719013.jpg]
    There is no work at all . only onething what u have to do is, give field length 8 on the screen for Time field. thats it .
    Regards,
    Venkat.O

  • How to display 3 month columns and YTD column

    Hello,
    I need a help. My report layout requires to display the data in 3 dynamic month columns and one Fiscal year Year-to-date column for a period of time. For example, ending month is FEB:
    Items : DEC : JAN : FEB : FY YTD
    A     : $10     : $11     : $12     : $100     
    B     : $1     : $2     : $3     : $10
    (Note: FY YTD is the total sum from OCT to FEB (5 months), not 3 months to be displayed)
    I tried to create a query and use Matrix with group, but the report always display five (5) month columns
    from OCT to FEB instead of displaying three (3) month columns. If the query is limited to display
    three months as desired, then the total sum will be 3 displayed months only (instead of 5 months).
    How to create a query or how to display three months and FY YTD or do anything else with Oracle Builder9i?
    Thanks,

    You could use the DECODE function and variables
    i.e. have a four column report
    in your query use somthing like
    , decode(period,:P_PERIOD1,1,0)* amount as period1
    , decode(period,:P_PERIOD2,1,0)* amount as period2
    , decode(period,:P_PERIOD3,1,0)* amount as period3
    , amount as ytd
    In your before report trigger poulate the variables with your required values

  • How to display array

    Hi, I have a problem to display array from my database. The following are the two files that I tried to input multiple values in mailaddress database in the second file and I tried to display the values from the database when the user login the first file. The values are recorded in the database well but I always got java.lang.NullPointerException error in my first file. I checked the code, it shows that array display wrong. Would you please help me? Thanks a lot in advance.
    <zhangmailinputtest.jsp>
    <%@ page language="java" contentType="text/html; charset=Shift_JIS" %>
    <%@ page import="beanYama.*,java.sql.*,java.util.*,java.text.*" %>
    <%@ include file="inc_conv_char.jsp" %>
    <%
    String uid =(String)session.getAttribute("uid");
    String unam =(String)session.getAttribute("unam");
    String depart =(String)session.getAttribute("depart");
    String perms =(String)session.getAttribute("perms");
    String flag =(String)session.getAttribute("flag");
    if(flag==null){
         response.sendRedirect("index.jsp");
    }else{
    %>
    <html>
    <body>
    <%!      String[] name;
         String[] departa;
         String[] email;
    %>
    <%
              Connection con = null;
              Statement stmt1 = null;
              ResultSet rsq = null;
              Class.forName("org.gjt.mm.mysql.Driver");
              con=DriverManager.getConnection("jdbc:mysql://localhost/progress?user=ntjs&password=ntjs&useUnicode=true&characterEncoding=Shift_JIS");
              stmt1=con.createStatement();
         rsq=stmt1.executeQuery("SELECT name AS name1 from mailaddress;");
              if(rsq.next()){
                   for (int i=0;i<name.length;i++) {
                   name[i] = rsq.getString("name1");
                   rsq.next();
              stmt1.close();
              con.close();     
    %>
    <form action="zhangmailtestfinal.jsp" method="post">
    <table width="60%" border="1" cellpadding="1" cellspacing="1" bordercolor="#000099">
    <tr>
    <td width="20%"><div align="center">Name</div></td>
    <td width="20%"><div align="center">Department</div></td>
    <td width="50%"><div align="center">Address</div></td>
    </tr>
    <tr>
    <td><input type="text" name="name" size="25" value="<%=name[0]%>" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    <tr>
    <td><input type="text" name="name" size="25" align="middle"></td>
    <td><input type="text" name="departa" size="25" align="middle"></td>
    <td><input type="text" name="email" size="53"align="middle"></td>
    </tr>
    </table>
    <input type="submit" name="save_button" value="Save">
    </body>
    </CENTER>
    </html>
    <%
    %>
    <zhangmailtestfinal.jsp>
    <%@ page language="java" contentType="text/html; charset=Shift_JIS" %>
    <%@ page import="beanYama.*,java.sql.*,java.util.*,java.text.*" %>
    <%@ include file="inc_conv_char.jsp" %>
    <%
    String uid =(String)session.getAttribute("uid");
    String unam =(String)session.getAttribute("unam");
    String depart =(String)session.getAttribute("depart");
    String perms =(String)session.getAttribute("perms");
    String flag =(String)session.getAttribute("flag");
    if(flag==null){
         response.sendRedirect("index.jsp");
    }else{
    %>
    <html>
    <body>
    <%!
         Connection con = null;
         PreparedStatement ps = null;
         ResultSet rs = null;
    %>
    <%
         String[] name = request.getParameterValues("name");
         String[] departa = request.getParameterValues("departa");
         String[] email = request.getParameterValues("email");
    try{          
              Class.forName("org.gjt.mm.mysql.Driver");
              con=DriverManager.getConnection("jdbc:mysql://localhost/progress?user=ntjs&password=ntjs&useUnicode=true&characterEncoding=Shift_JIS");
              Statement stmt0=con.createStatement();
              stmt0.executeUpdate("delete from mailaddress");
              String query ="INSERT INTO mailaddress (mail_userid,name,departa,email) VALUES (?,?,?,?)";
              ps = con.prepareStatement(query);
                   for (int i=0;i<name.length;i++){
                   ps.setString(1,uid);
                   ps.setString(2, name);
                   ps.setString(3, departa[i]);
                   ps.setString(4, email[i]);
                   ps.addBatch();
              ps.setString(4,uid);
              int[] results = ps.executeBatch();
              Statement stmt1=con.createStatement();
              ResultSet rsq=stmt1.executeQuery("SELECT name AS name1 from mailaddress where mail_userid=" + "'" + uid + "'" + ";");
              if(rsq.next()){
                   for (int i=0;i<name.length;i++) {
                   name[i] = rsq.getString("name1");
                   rsq.next();
    } catch (Exception e) {
                   throw new ServletException(e);
              } finally {
                   try {
                        if(rs != null) {
                             rs.close();
                             rs = null;
                        if(con != null) {
                             con.close();
                             con = null;
                   } catch (SQLException e) {}
    %>
    </html>
    <%
    %>

    Where exactly is the exception being generated?
    My guess is this bit here:
    if(rsq.next()){
      for (int i=0;i<name.length;i++) {
        name = rsq.getString("name1");
        rsq.next();
    }I don't think your name array has been initialised in this file. Plus it assumes that the name array has exactly the same number of items as the query returns. To me thats rather dubious...
    I would suggest this instead
    while (rsq.next()){
        name = rsq.getString("name");
    }I'm still not entirely certain what you are trying to accomplish, but thats probably the cause of the null pointer.
    good luck,
    evnafets

  • How to display date on homescreen and not the prof...

    I've been looking around at theme and noticed pretty much all of them have the date displayed on the homescreen and no profile type name either?
    thanks for any help
    Solved!
    Go to Solution.

    as i know , the only way to show date is by using general profile and no other way
    -you can show appreciation to my posts if it helped or useful by pressing the green Kudo star beside my post that hepled
    -if my answer was the solution , so click accept as solution button
    Started From Nokia 3310 , Now with Nokia N97 v.22.0.110 + N900 PR1.2

  • How to display an image as a button

    how to make an image like a button ; when we press the image it performs a command

    Or you could use a form with an ImageItem with a button appearance:
    Image myImage = ...
    ImageItem("MyButton", myImage, Item.LAYOUT_CENTER, Item.BUTTON);and then add an ItemCommand to the ImageItem.
    jc

  • Japanese indication of Label and Button is strange in Android5.0.1.

    A screen of attachment is Label, TextArea, Button in turn from the top.
    TextArea is normally indicated, but all hiragana, katakana and kanji aren't shown to Label.
    Hiragana and katakana aren't shown to Button.
    Nexus7(2013) Android5.0.1 AIR15.0.0.381
    AIR Simulator

    Hi Ankit,
    Not sure if this is a right place to raise, I also found that the Spark Label is not rendering Chinese characters correctly. Attached is a screen shot for your reference.
    Testing Environment
    Android 5.0.1
    Apache Flex 13
    Adobe AIR 15
    The same application works well on Android 4.x.
    Cheers
    Vicker

  • Query en web labels and buttons

    Hi all!!
    I have this requeriment,
    When i see the query in format web; we have this labels or buttons: bookmark, variable screen, exceptions and conditions, etc etc.... when i put the mouse on this buttons; appear a text that says: bookmark button, variable sreen button, exceptions and conditions button, etc....
    Is possible to remove this messages???
    I think that is necessary to change some standar code, but im not sure; I want to know what happend or if we have a note that mention this area.
    Thanks in advanced,
    Greetings,
    Mónica

    Hi
    if I understand your requirement correctly, you r referring to the Tool Tips for buttons on Web.
    You can turn off these in the XHTML code for the template , simply by removing the statement,
    <bi:TOOLTIP value="XXXXX" />
    Or in the property for the button group.
    I hope this helps you,
    Shakeel.

Maybe you are looking for

  • Error message during upgrade 8.0.6 - 9.2.0.1

    Hi, during the database upgrade, with the Oracle's assistant, at the end of stage 1, an strange error appears. The text of this message is simply : "6500000,L" ! What do that mean ? Thanx, Fabrice

  • Firefox is already running, no applications found no parent lock

    THe Browser crashed when attempted to open a new tab at Verizon site. Now Both my Beta and reg Firefox are showing the infamous pop-up message already running ..need to close it first etc. .But no apps running no processes running, no parent lock fou

  • Printing Pictures

    How do I print 4x6 pictures on HP Everyday Glossy photo paper. The application I'm trying to use is Adobe PhotoShop Elements 9. When I go in a click print then setup the printer to use borderless 4x6 paper and click print it prints a small picture. I

  • TS2972 Apple TV cannot connect to my iTunes library

    my Apple TV cannot connect to my itunes library

  • How to define the size of each column of a GridLayout in HTMLB?

    Hi there, I think everything is in the subject. It seems it is not possible. The GridLayout.setWidth() refers to the grid in general and it is not possible to select a GridLayout column (in order to apply to it a setWidth()). When I do a GridLayoutCe