Number of of lines in af row.

Hi Experts.
I need some help. I'm trying to display JTextAreas in a table using the TableCellRenderer interface. My problem is that I have to display more than one line in each row (I need linewrap). I think the tables cell size prevents the expansion of the JTextArea. I've posted my code and marked the important places:
package box;
import java.applet.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import java.util.ArrayList;
import javax.swing.table.TableCellRenderer;
public class GUI
    extends Applet {
  boolean isStandalone = false;
  BorderLayout borderLayout1 = new BorderLayout();
  JTextField tArea1 = new JTextField();
  Label tArea2 = new Label();
  JButton jButton1 = new JButton();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();
  JPanel rightPanel = new JPanel();
  JPanel leftPanel = new JPanel();
  JPanel leftTopPanel = new JPanel();
  JPanel leftBotPanel = new JPanel();
  JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  Thread graphFrame;
  dbInterface db = new dbInterface();
   Connection dbConn = null;
  //Get a parameter value
  public String getParameter(String key, String def) {
    return isStandalone ? System.getProperty(key, def) :
        (getParameter(key) != null ? getParameter(key) : def);
  //Construct the applet
  public void init() {
    int lastValue;
    jbInit();
    lastValue = db.getLatest(dbConn);
    String temp = Integer.toString(lastValue);
    showText(temp);
  //Component initialization
  private void jbInit() {
    dbConn = db.dbConnect();
    this.setLayout(new XYLayout());
    tArea1.setBackground(Color.lightGray);
    tArea1.setBorder(null);
    tArea1.setDisabledTextColor(Color.white);
    tArea1.setText("56");
    tArea1.setHorizontalAlignment(JLabel.CENTER);
    tArea2.setAlignment(Label.CENTER);
    tArea2.setBackground(Color.lightGray);
    tArea2.setText("");
    tArea2.addMouseListener(new GUI_tArea2_mouseAdapter(this));
    jButton1.setText("Set temperature");
    jButton1.addMouseListener(new GUI_jButton1_mouseAdapter(this));
    jButton1.addActionListener(new GUI_jButton1_actionAdapter(this));
    jLabel1.setText("From db");
    jLabel2.setText("UI");
String[] columnNames = {"test"};
Object[][] data = {{new JTextArea("Max f sf sf sf a fas f dsf s fds f dsf ds")}, {new JTextArea("test")}};
JTable table = new JTable(data, columnNames);
table.setDefaultRenderer(Object.class, new TableRenderer());
    leftPanel.setLayout(new XYLayout());
    rightPanel.setLayout(new XYLayout());
    leftTopPanel.setLayout(new XYLayout());
    leftBotPanel.setLayout(new XYLayout());
    rightPanel.add(tArea1, new XYConstraints(50, 50, 30, 20));
    rightPanel.add(jLabel1, new XYConstraints(50, 30, -1, -1));
    rightPanel.add(jButton1, new XYConstraints(50, 80, 120, 22));
    rightPanel.add(tArea2, new XYConstraints(140, 50, 30, 20));
    rightPanel.add(jLabel2, new XYConstraints(140, 30, -1, -1));
    splitPane.setLeftComponent(leftPanel);
    splitPane.setRightComponent(rightPanel);
    splitPane.setDividerLocation(150);
    splitPane.setDividerSize(6);
    JScrollPane scrollPane = new JScrollPane(table);
    leftTopPanel.add(scrollPane, new XYConstraints(0,0,149,200));
    leftPanel.add(leftTopPanel, new XYConstraints(0, 0, 150,200));
    this.add(splitPane, new XYConstraints(0,0,400,300));
  private void showText(final String text) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        tArea2.setText(text);
        // Check if the new value crosses the specified limits
        checkBounds(tArea2);
  public void checkBounds(Label tArea2) {
    // Parses the value in the tArea2 as an integer
    int value = Integer.parseInt(tArea2.getText());
    // Check if the limit is passe
    if (value > 100) {
      tArea2.setBackground(Color.red);
    else {
      tArea2.setBackground(Color.lightGray);
  } class TableRenderer extends JLabel implements TableCellRenderer {
public TableRenderer() {
setOpaque(true);
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
JTextArea textA = (JTextArea) value;
textA.setLineWrap(true);
System.out.println("renderer");
textA.setBackground(Color.red);
return textA;
}  public void jButton1_actionPerformed(ActionEvent e) {
    String input = tArea1.getText();
    showText(input);
  public void tArea2_mouseClicked(MouseEvent e) {
    this._disable();
    graphFrame = new Thread(new graphForm(this));
    graphFrame.start();
  public void tArea2_mouseEntered(MouseEvent e) {
    setCursor(new Cursor(Cursor.HAND_CURSOR));
  public void tArea2_mouseExited(MouseEvent e) {
    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
class GUI_jButton1_actionAdapter
    implements ActionListener {
  private GUI adaptee;
  GUI_jButton1_actionAdapter(GUI adaptee) {
    this.adaptee = adaptee;
  public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
class GUI_jButton1_mouseAdapter
    extends MouseAdapter {
  private GUI adaptee;
  GUI_jButton1_mouseAdapter(GUI adaptee) {
    this.adaptee = adaptee;
class GUI_tArea2_mouseAdapter
    extends MouseAdapter {
  private GUI adaptee;
  GUI_tArea2_mouseAdapter(GUI adaptee) {
    this.adaptee = adaptee;
  public void mouseEntered(MouseEvent e) {
    adaptee.tArea2_mouseEntered(e);
  public void mouseClicked(MouseEvent e) {
    adaptee.tArea2_mouseClicked(e);
  public void mouseExited(MouseEvent e) {
    adaptee.tArea2_mouseExited(e);
}

Search the Swing forum. This question has been asked twice in the last couple of days.

Similar Messages

  • Printing fixed number of  Invoice Line in rtf template with level two group

    Hi,
    I have to print fixed number of invoice lines on a page. Invoce tempalte design has a table with header and summary(Invoice , tax and shiping totals) at each page in table footer. The table should repeate at each page with header and footer. I need to print specific number of rows or number of rows wihich page can accumulate in table body on each page.
    I checked few blogs giving solution for fixed number of rows printing say
    "Anatomy of a Template I - Fixed Row Enumeration"(http://blogs.oracle.com/xmlpublisher/2007/03/27/)
    and
    http://oracle.anilpassi.com/xml-publisher-developing-reports-printed-on-pre-printed-stationary-2.html
    Above two blogs explanation has only one group at line level. but in my case there are two groups (Parent and child) at line level. I am able to count rows in parent group but it is not counting lines in child group.
    Edited by: Bhanu Yadav on Apr 19, 2011 2:10 AM

    Will it be possible for you to move the 1st and 3rd sections to header/footer?
    So that if the 2nd section spills over to next page too, starting position of 3rd section wont be affected.

  • Setting visible lines and blank rows for all users

    At Item Level for Shopping Cart, Confirmation and Invoice Creation there are settings for Number of Visible Rows and Number of Blank Lines (In Settings/Advanced Settings).
    How can this be changed for all users?

    Hi
    This is a user specific settings to be performed. in SRM 7.0
    Please prepare a document and educate the user to do. This is  the best solution
    Second Solution
    In Setting tabs there are two tabs -Basic Setting and Advance Setting
    check the webdynpro components and hide this for all users
    Regards
    G.Ganesh Kumar

  • How to find the number of fetched lines from select statement

    Hi Experts,
    Can you tell me how to find the number of fetched lines from select statements..
    and one more thing is can you tell me how to check the written select statement or written statement is correct or not????
    Thanks in advance
    santosh

    Hi,
    Look for the system field SY_TABIX. That will contain the number of records which have been put into an internal table through a select statement.
    For ex:
    data: itab type mara occurs 0 with header line.
    Select * from mara into table itab.
    Write: Sy-tabix.
    This will give you the number of entries that has been selected.
    I am not sure what you mean by the second question. If you can let me know what you need then we might have a solution.
    Hope this helps,
    Sudhi
    Message was edited by:
            Sudhindra Chandrashekar

  • Report invoice document number againt PO line item

    Hi Forums,
    Can any body so kind to tell me is there any standard report in SAP 4.7 C where we can get the list of invoice document number against each line item of PO.
    I have tried the ME2N & ME2L report. If I double click the POH then only it give me the invoice document report. But i want a report where I get invoice document no against each line item wise in PO.
    Thanks in advance.
    Regards,
    sp sahu

    Hi sp sahu,
    I am sorry, but I am not aware of any report which might suit your requirements, this is the reason why I addressed you to the table EKBE. You might build your own report out of this table.
    Sorry!
    Esther.

  • Ignore the number of schedule lines in sale order item when run MRP

    Dear All,
    I have a problem when I create production order (discrete manufacturing)
    When I create a sale order with one sale order item and 3 schedule lines for this sale order item.
    After that, I run MRP for this sale order, what I get is 3 planned orders for 3 schedule lines. It means that I will have 3 production orders for 1 sale order item.
    I want  create one production order for one sale order item whatever the number of schedule lines in sale order item.
    I think I have to config in MRP. Please help me.
    Thanks in advance

    Dear
    Check in OPPQ then look in Master data Availability Check & strategy for material also check whether u have maintained strategy for same material and see did u extended sales views for other material
    As u said 3 schedule lines for this sale order item check whether u have extended sales views for next material
    With Regards
    Pushpalas

  • Schedule line number determination - Schedule line category CP(MRP)

    Hello All,
    I want to know on what basis schedule line numbers getting determined.
    Schedule line category: CP-MRP
    Sales order line items getting confirmed based on the Planned order--> production order created through MRP run.
    I have created sales order line item 1 with 100 quantities. for example I created today. RDD also today.
    3 production order created.
    Those production orders confirmation date as below.
    Production order 1 - 60 quantities - 14.04.2014
    Production order 2 - 30 quantities - 16.04.2014
    Production order 3: 10 quantities - 18.02.2014.
    There are four schedule lines for the line item 1.
    All the 4 lines showed as per the confirmation date order.
    But the schedule line numbers are not as per the above order.
    For example,
    Schedule line number   ----- delivery date ----- Confirmed qty
    1.                                         09.04.2014            0
    3.                                         14.04.2014            60
    2                                          16.04.2014           30
    4                                          18.04.2014            10
    On what basis this schedule numbers getting determined? Is there any standard procedure ?
    Why schedule line numbers not inline with the confirmed date?
    Let me know if you need more information.
    Thank you.
    Regards,
    Rakkimuthu C

    Hi,
    Schedule line number is the number that uniquely identifies the schedule line .
    Use When an item has more than one schedule line, the system automatically assigns a unique number to each line. The number is displayed in the details screens for schedule lines.
    Note The schedule line number serves internal purposes and does not, for example, determine the sequence of schedule lines in the overview screen. The schedule lines on the overview screen are sorted by date.
    The schedule line number will get created automatically by the system. I hope this will clarify your doubt. Thanking you.

  • How to Count Number of completed line items in past 6 months / 12 months ?

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how

    Hello Deva
    If youe want to calculate the completed line item for last 6 or 12 month then i think u will be displaying the query data for these montrhs...create a customer exit to give you date range and restric it in filter area....
    Now Choose any of the below option
    1. I would suggest to implement an additional key figure "counter" in cube and fill values with one for which delivery is completed.
    Now use calculated key figure in Query Designer based on logic
    IF counter = 1 THEN counter ELSE 0
    OR
    2. create a formula variable based on ELIKZ and use replacement path variable, it will display you no. of docs for which delivery is completed....
    Award points if it solves your problem
    Revert back in case of further assistance...
    Thanks
    Tripple k

  • Total of the number of stock lines held in storage at any given time

    Hi Experts,
      Is there a transaction we could use that will quickly give us a total of the number of stock lines held in storage at any given time? can anyone please advise
      Many Thanks

    Solved.
    SE16 and table LQUA or LAGP. LAGP is more logical but takes longer to generate the result.
    Regards
    Simon

  • Purchase Order Number in Vendor Line Item (FBl1N) and Clear Vendor (F-44)

    Hello,
    I am not getting the Purchase Order Number in Vendor Line Item.(FBl1N).
    Also during Clear of Vendor through F-44 i am not able to identify the Line item on the basis of Purchase Order Number.
    Could any one pleae help me out on this issue as i have to clear the vendor Line item in mass.
    Thanks
    Nitin Jindal
    Moderator: Please, respect the rules of the forum and search SDN before posting new thread. This question has been answered several times. Also, please choose proper forum to post your questions; this one is related to Financials and not to Controlling

    Based on my experience std feature from SD-FI . Depending on the SD Billing config which can be by delivery(VTFL) or sales order(VTFA). You can assign options of A: Cust PO No. B Sales order no. C Delivery no. D External delivery no.  E Actual invoice number to available header fields of Assignment No. or Reference No. Try it out

  • BP number in GL Line Item Report

    Hello Gurus,
    Is there a way to view BP number in GL Line Item Report FBL3N ? I went through the dynamic selection, but didn't see any option for BP. My client wants to see BP info in certain GL accounts without referring back to treasury transactions.
    Thanks in advance,
    Pal

    Hi,
    Unfortunately, there is no standard linkage to BP in FI document postings.  You can see the customer number if there is one and then link it to the BP.  But in case you want to see it at the G/L item level, then 1 thing you can do is have a custom code through BADI_TRM_ACC and fill the BP number to assignment or reference field.  This way you can check it in the accounting document item.
    Regards,
    Ravi

  • Number of displayed lines in a table

    Hello colleagues,
    We are using a table with a master column (tree). Additional we are using an input field where a user can enter a number so that the displayed lines can be change at runtime.
    Problem:
    I would like to know the displayed number of lines as it is displayed in the button line of the table in the view (where a user can jump direct to a line) - but I do not know how I get it.
    Question:
    How do I get the content of the max number of available lines in the button of the displayed table?
    Thanks+greetings,
    Achim

    Hey Maheswaran.B,
      thanks for the reply - the problem is not solved with the suggestion (because I do not get the maximum number of line displayed).
    I did the following:
    On the very first time if "modifyView" will be executed I do a loop over the table. If the maximum number is reached within the loop I set this number - if not I set the number of loops.
    Here is a code example:
       DO 10 TIMES.
          ADD 1 TO l_counter.
          CLEAR elem_tabletree.
          elem_tabletree = node_tabletree->get_element( index = l_counter ).
          IF elem_tabletree IS  INITIAL.
            SUBTRACT 1 FROM l_counter.
            EXIT.
          ENDIF.
        ENDDO.
    *--- set the value to the bound variable
        elem_owner_node->set_attribute(
          EXPORTING
            name =  `NUMBER_OF_LINES`
            value = item_number_of_lines ).

  • Incorrect number of data lines in TST03

    Hi,
    one of our scheduled jobs is being cancelled with no errors but those found on SP12 - Consistency Check:
    Incorrect number of data lines in TST03
    Any idea of what might be happening?
    SM21 reports the following:
    Error 13 for write/read access to a file. File =
    Error at DB commit, return code 016384
    SAP Commit Failed
    Stop Workproc20, PID 9915
    Start Workproc20, 4 times since system startup. PID 10255
    Invalid object name for TemSe object: " "
    Failed to create log for job /SAPAPO/BACKGROUND_SCHEDULING
    Calling program reports invalid handle for TemSe object (magic==X'NULL-ptr')
    Delete session 001 after error 023
    Thanks
    Antonio

    Hi Naveen...
    yes, the problem was solved but it had nothing to do with SAP itself...
    We have our APO system on two servers: the message server (and DB) runs on an iSeries and the application server and LiveCache server on a SuSE Linux machine. This last server has several iSeries shared (NFS) folders mounted and all TemSE objects are created on one of these folders.
    Now the problem is we use a Vision solution for our HA. Whenever Vision is "touching" a file, Linux can't "see" the lock status due to NFS limitations. So, when it is trying to access the same file, a "permission denied" error message is issued to SAP, causing the job to abort and the TemSE object to become inconsistent.
    One solution is to change from NFS to Samba.
    Another one, much faster to implement, is stopping the Vision job during the night period, when those SAP jobs run. Since then, we didn't had any more problems.
    Of course, this is simply a workaround and not a permanent solution!
    Could this be your scenario as well?
    I hope you can solve your problem...
    Merry Christmas and a Happy 2009 for everyone!
    Antonio

  • Can I switch my phone number between two lines(not just between phones)?

    I have 4 months left on my current plan. I would like to take advantage of current holiday sales to get the droid razr for cheap. I am considering adding an additional line to my plan to get the upgrade. The problem with this is that I either have to use the new number and let my other contract end or continue on with my current number and pay for 2 lines for the next 2 years. I noticed that verizon lets you switch the phone number that is associated with your line. Would I be able to add an additional line to my plan and then switch the numbers between these two lines? Essential line A has number A and ends in 4 months, line B has number B and ends in 20 months, and I want to make it so that line B has number A and then only pay for line A for the next 4 months. Is this possible?

    Verizon does not allow you to switch numbers since they are tied to your contact. However, there's a work around, because Verizon does allow you to port a number from another carrier to overwrite the existing number without changing your contract. So here's what you need to do:
    1. Get the Razr cheap like you wanted on a secondary line;
    2. Wait for 4 months so your main line contract is up;
    3. Port out your main line number to another carrier, for example, Pageplus;
    4. Wait till your bill cycle is passed and port that number from Pageplus to Verizon, overwrite the number on secondary line.
    After step 4 you will have your main number back on the line with the Razr.

  • In iPhoto  how do I open Photo Grid to change number of caption lines?

    In iPhoto  how do I open Photo Grid to change number of caption lines?

    In iPhoto '11 you can only display two lines below the thumbnails of your photos when you browse an event or an album, the titles and the ratings. The title will be truncated, if it does not fit into the single line. From the iPhoto help:
    To show title and rating information below photos:
    Click to select Photos in the Source list.
    Choose View, and then choose the information you want to view:
    Titles
    Rating
    The information field you chose appears below your photos.
    To hide this information, choose View, and then choose the information you want to hide.
    Regards
    Léonie

Maybe you are looking for

  • Crash while saving

    Hi, I am facing this problem with LV2010. I am using windows 7 32-bit. Please refer to my attached vis. 6dof_v10 is the main vi while TCP init_stop and TCP start are both sub vis inside 6dof_v10. I have extracted much of the algorithms inside the con

  • It seems that I can't use isqlplus with IE!

    Hi all, I have a server 9.2.0.4 on WhiteBox Linux. I have also client machines under Windows 2000 Pro. When I try to use Internet Explorer with isqlplus, I can get into a session but any execution throws the following error: SP2-0915: cookies may hav

  • No Firewire 400 on the new Mac Pro's

    So anyone out there have experience using Firewire 400 to 800 cables with audio interfaces? Are there any known performance issues?

  • WRT54G hangs intermittently

    IE7 and Firefox both hang and freeze at times. Clicking a link gets me nowhere...just sits there.  I have tried all recommended troubleshooting steps for both.  Nothing seems to work.  I checked the system event log and found this error message: "Una

  • Does anyone have Windows and cache on an SSD?

    A variation/simplification of my previous post. Has anyone managed to use an SSD with both an SRT cache partition and a Windows operating system partition on a Z68 board? If so, please tell me which board/ BIOS version/ RAID ROM versions (CTRL-I)/ IR