Off-topic Talk Where overpaid, underworked S2000 owners waste the worst part of their days before the drive home. This forum is for general chit chat and discussions not covered by the other off-topic forums.

Possible to highlight a row in a text area which in turn would fire an event in Java?

Thread Tools
 
Old May 8, 2003 | 01:01 PM
  #1  
s2kdriver80's Avatar
Thread Starter
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Nov 2002
Posts: 2,048
Likes: 8
From: Long Island, New York, US
Default

I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?

I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.

TIA

Oh, and the reason that I think I want to do this in a text area is because there could be a huge list of problems (like 200) yet the GUI can only show so much at a time and I know that a text area can have scroll bars to browse the list. If there is an easier way (i.e. w/o the use of a text area but can "scroll" please let me know. TIA.
Reply
Old May 8, 2003 | 02:03 PM
  #2  
The Unabageler's Avatar
Former Moderator
 
Joined: Oct 2000
Posts: 20,448
Likes: 0
From: internet
Default

I just made a very complex cross-browser DOM compliant GUI in javascript/dhtml for administering web content. dynamic page sizing, drag and drop, dhtml popups, the works. too bad it's my company's property or i'd show you.

as for your question:
you can't highlight a row in a text area. suggestion: use a div and put each line in a span. then you can change the span's style when the span gets an onClick. i.e.:

<span id="row1" style="background-color:white" onClick="doPopup('row1');this.style.backgroundColo r='red';">row text goes here</span>

you can put it all in an iframe instead of a div if you want scrolling.
Reply
Old May 8, 2003 | 02:05 PM
  #3  
The Unabageler's Avatar
Former Moderator
 
Joined: Oct 2000
Posts: 20,448
Likes: 0
From: internet
Default

hit me up on icq if you need help on what i said
Reply
Old May 8, 2003 | 02:15 PM
  #4  
Muz's Avatar
Muz
Former Sponsor
 
Joined: Oct 2000
Posts: 9,081
Likes: 0
Default

[QUOTE]Originally posted by SiDriver
[B]I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?

I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
Reply
Old May 8, 2003 | 06:39 PM
  #5  
s2kdriver80's Avatar
Thread Starter
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Nov 2002
Posts: 2,048
Likes: 8
From: Long Island, New York, US
Default

Sorry guys, I should have said it in my post and not just the title - I need to do this in Java (Swing). Thanks for the help anyway. Anyone else?

Thanks.
Reply
Old May 9, 2003 | 11:31 AM
  #6  
RiceBurnerTX's Avatar
Registered User
 
Joined: Dec 2002
Posts: 1,505
Likes: 0
From: Austin
Default

I would add a button after the text box and have your application read what is highlighted when you click on the button....
Reply
Old May 11, 2003 | 04:54 AM
  #7  
rbackhouse's Avatar
20 Year Member
Active Streak: 30 Days
Active Streak: 60 Days
 
Joined: Sep 2002
Posts: 450
Likes: 0
From: Apex NC
Default

Take a look at javax.swing.JTable. It should do every thing you need.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
fltsfshr
Off-topic Talk
2
Feb 7, 2009 05:35 AM
mxt_77
Off-topic Talk
12
Oct 14, 2007 01:43 PM
steven975
Off-topic Talk
13
Oct 31, 2004 01:30 PM




All times are GMT -8. The time now is 12:54 AM.