Howto: Display text in the border line of the JPanel

I create a JPanel and set it's border, later i add a textField at the border line of the JPanel, but when the words i type in, the line of border still at the center of the textField. Pls Help

try this:
import javax.swing.border.*;
TitledBorder myBorder = new TitledBorder(" my Title ");
myPanel.setBorder(myBorder);
null

Similar Messages

  • Display text in textArea, multiple lines

    Hi. I have a file that i read, that contains a unknown number of lines, separated with \n. I want these lines to be printed out in the text area. i've tried to use setText() but it only displayes the last line in the file, and not all of the lines. i use a while loop to read from the file till end of file. when i print the lines out to the commend prompt window, all lines are printed out. Is there a swing command that prints out all the lines?
    while ((myFileInfo= infile.readLine()) != null)
    System.out.println(myFileInfo); //prints all lines
    myTextArea.setText(myFileInfo); //prints only the last line???
    }

    StringBuffer buff = new StringBuffer();
    while ((myFileInfo= infile.readLine()) != null)
    System.out.println(myFileInfo); //prints all lines
    buff.append(myFileInfo);
    buff.append("\n");
    myTextArea.setText(buff.toString());

  • How to only read the last line in the text file by using BufferedReader ?

    Dear all,
    Hello, I am new to Java. Do anybody know how to read the last line (this is the last record) in the text file.The method I am now using is reading from the first line until I reach the last line in the text file. Thank you!!
    BufferedReader br = new BufferedReader(new FileReader("c:\\sdk1.4.1\\bin\\dbExport.txt"));
    DataInputStream in = new DataInputStream(new FileInputStream("c:\\sdk1.4.1\\bin\\dbExport.txt"));
    String input;
    String firstinput;
    String secondinput;
    int count=90;
    int year=1955;
    while ((input = br.readLine()) != null) {
    firstinput = input.substring(0, 10);
    secondinput = input.substring(10);
    String insertStore1 = ("INSERT INTO AUTHORS " +
    "VALUES ('" + count + "', '" + firstinput + "', '" + secondinput + "', 1955)");
    System.out.println(insertStore1);
    int result = stmt.executeUpdate(insertStore1);

    I suppose you could use a java.io.RandomAccessFile.

  • The white line over the text in a title

    how can I enlarge the white line over the text in a title to not have the text out of the frame when I want to add another line?

    If you are speaking of the white bar upon which you are entering text in say a 'gradient edge' title, click title in the inspector window having the title selected. There you can change the width of the horizontal bar:
    In the screenshot above I have used gradient edge title. The bar is of black color and you can change the color to white or any other color by tinkering with the controls in the inspector window [red oval]; you can also increase or decrease with the bar's width by changing its parameters within the 'yellow rectangle'; and, if you so need, you can push up or push down the bar by manipulating the bar vertical position tool located below the yellow rectangle.
    Hope this helps. If the white line you have mentioned above is something other than the bar I have referred to, then let me know. Cheers. Have a great day.

  • Could not parse the file contents as a data set. There were too many variable names in the first line of the text file.

    Could not parse the file contents as a data set. There were too many variable names in the first line of the text file.

    What are the Variables settings, what is the text file’s content, …?

  • How to decrease the width of the border line of a table in smartform in 4.7

    hi all,
    i want to decrease the width of the border line of a table in smartform in 4.7 version. how can i do it? plz reply.

    Hi,
       When u r going to create a table in forms it will show the all details regarding the tables
    like  -> color
           -> width etc...
    From there u can do that .
    u can also select the table format as all ready defined formats i.e available in he same screen.

  • How can I adjust the space between the dividing line of the footnotes and the continuous text?

    How can I adjust the space between the dividing line of the footnotes and the continuous text?

    I want to extend the space so the dividing line does not stuck to the normal (continuous) text in my thesis. Do you have a solution? That would be perfect. Thanks a lot!

  • How to make the last line of the textarea visible all the time?

    Hello,
    I am making an online chat application in JSP and XHTML. The chat log and online users� names textareas are refreshed every 5 seconds. When it comes to many messages in the chat log textarea, the scrollbar appears. Then, every time the chat log textarea is refreshed, I need to move the scrollbar down to see the last line of the textarea.
    Are there any ideas how to make the last line of the textarea visible all the time without moving the scrollbar?
    Thanks in advance.
    Dan

    I put the below code on the page, but it didn't work.
    Are there any ideas? Thanks.
    <table border="0" cellspacing="1">
    <tr>
    <th>Chat Log</th>
    <th>Users now online</th>
    </tr>
    <tr>
    <td><textarea rows="20" cols="60" name = "messages" readonly = "readonly"><%= texts %></textarea></td>
    <td><textarea rows="20" cols="20" name = "names" readonly = "readonly"><%= names %></textarea></td>
    </tr>
    </table>
    <script type="text/javascript">
    <!--
    document.messages.scrollIntoView(false);
    //-->
    </script>

  • How do I prevent Pages from pushing paragraphs to next page when they would otherwise begin on the last line of the previous page?

    I am writing papers for school which have strict page limits so I can't afford to be losing lines at the bottom of a page because Pages thinks it looks better to have a new paragraph start on the next page. It does this automatically and I have to go back and manually format to get the first line of the paragraph to start on the last line of the previous page. This then creates problems down the line when I am editing so I would really like to be able to turn the feature off.
    e.g. with Pages auto-formatting
    -----page 1-----
         Paragraph #1 blah blah
    blah blah blah
         Paragraph #2 blah blah
    blah blah blah
    -----page 2-----
         Paragraph #3 blah blah
    blah blah
    e.g. after manual formatting
    -----page 1-----
         Paragraph #1 blah blah
    blah blah blah
         Paragraph #2 blah blah
    blah blah blah
         Paragraph #3 blah blah
    -----page 2-----
    blah blah

    Change the keep with next rules in:
    Inspector > Text > More > Pagination & Break
    Peter

  • How to get the Grid lines in the background of bar chart

    How to get the background of bar chart given in the following link
    http://javafx.com/docs/articles/controls/barChart.jpg
    thanks in advance

    Set the border attribute of the table tag to zero.  Use CSS to assign your borders like this -
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style type="text/css">
    table {
              border-collapse:collapse;
              border:1px solid black;
    tr {
              border:1px solid black;
    tr.top {
              border-bottom:none;
    tr.bottom {
              border-top:none;
    </style>
    </head>
    <body>
    <table width="600" border="0">
      <tr class="top">
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr class="bottom">
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
    </table>
    </body>
    </html>

  • IO7 in good, but the fine lines of the characters are a nuisance. Is there a way to convince Apple to offer a better style for aging persons with limited vision?

    iO7 in good, but the fine lines of the characters are a nuisance. Is there a way to convince Apple to offer a thicker letter type for aging persons with limited vision?

    I turned on Bold Text - the phone will restart itself, that's normal - and it is now MUCH easier on my eyes.
    Give it a try.

  • JSP for Vcard cannot strip carriage return in the last line of the file.

    I am using JSP to output a Vcard (http://en.wikipedia.org/wiki/VCard)
    The following code works great in Windows but fails on the mac:
    <%@ page contentType="text/x-vcard" %><%--
    --%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--
    --%><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %><%--
    --%>BEGIN:VCARD
    VERSION:2.1
    <c:choose><%--
    --%><c:when test="${not ((empty param.lan) and (empty param.fin)) }"><%--
    --%>N:${param.lan};${param.fin}
    FN:${param.fin} ${param.lan}
    </c:when><%--
    --%><c:otherwise><%--
    --%>FN:${param.org}
    </c:otherwise><%--
    --%></c:choose><%--
    --%>ORG:${param.org}
    TITLE:${param.title}
    TEL;WORK;VOICE:${param.phwork}
    ADR;WORK:;;${param.st};${param.city};${param.state};${param.zip};
    EMAIL;PREF;INTERNET:${param.email}
    REV:20080424T195243Z
    <c:out value="${fn:replace('END:VCARD','\\\r','')}" escapeXml="false"/>After some tests, I discovered that Mac (I used Tiger, latest update, not Leopard) needs extra white space and carriage returns stripped off. Once this is achieved, the vcard will automatically import into Address Book. I have followed other forums which advice on using JSP comments as in the code above. But for some strange reason the last line of the JSP outputs an extra carraige return. How do I get rid of the carriage return at the end of the file? the replace function from JSTL is not working.
    Edited by: shogo2040 on Dec 18, 2008 7:11 PM : I added more detail to the Subject

    I originally had that END:VCARD without any carriage return.
    But I still get an extra carriage return at the end when the JSP renders to VCF
    I'm using Tomcat running on Linux.
    I found this, article which implies (but does not explicitly say) JSP in general adds a newline to the last line:
    http://www.caucho.com/resin-3.0/jsp/faq.xtp (But its not tomcat either, so maybe this info is irrelevant).
    Edited by: shogo2040 on Dec 22, 2008 3:31 PM - changed rendered to VCF from rendered to JSP

  • To delete the last line of the internal table

    How to delete the last line of the internal table.???????
    The list which gets displayed from the internal table adds a dummy line at the last which shows zeros and zeros.all the otheer selections are perfect.i just want to delete the last line which comes as zero zero.is there any way to do it...

    Quite Easy......Use Describe command to Count the Total Number of Table Lines, and then Delete the Last Line using Index.
    Data L like sy-tabix.
    Describe Table Itab Lines L.
    Delete itab index L.

  • How to remove the blank lines at the end of the JTextArea .

    Hi,
    I need to remove the blank lines in the JTextArea at the end. Suppose i am giving 'A' in the first line and press the enter key two times, after i am giving the 'B' in the third line and press enter key for two times. I need to remove, the last two lines of JTextAreae, . How i can remove these lines?

    String#trim() removes all whitespace from both ends of the String.
    The requirement was to remove line breaks from the end of the String only.
    String#replaceAll with a suitable regex would do the trick. Untested regex for this:text.replaceAll("[\\n\\r]+$", "")db

  • How can I put information in the status line at the bottom of the window

    Hi, I need to put some information on the status line, like username and database name. How can I do this?
    If someone know how to do this and could show some sample code, please, put in this.
    Thank you,
    San

    Thanks, but this put a message in the message line, and I need to put this in the status line below the message line, where are displayed messages like "enter query", "execute query", "list of values" and etc...
    Is this possible?
    Thanks

Maybe you are looking for