f



how to dispay a text file contents in a text area or label

hi,

can any one help me abt this,

i have a small task in which i have to display file contents on a
jlabel. i have tried it using system.out.print() but how can i get the
file contents on jlabel.

0
1/4/2005 11:13:49 PM
comp.lang.java.help 13340 articles. 0 followers. Post Follow

2 Replies
745 Views

Similar Articles

[PageSpeed] 20

zubairkhan wrote:
> hi,
> 
> can any one help me abt this,
> 
> i have a small task in which i have to display file contents on a
> jlabel. i have tried it using system.out.print() but how can i get the
> file contents on jlabel.
> 

Are you asking how to _set_ the _text_ on a component?
I think you may want to see the setText() method...

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JLabel.html#setText(java.lang.String)

Carl.
0
cag_ng (57)
1/4/2005 11:20:07 PM
thanku  carl for reply. but it was not what i needed, however i got it..

0
1/5/2005 2:42:06 PM
Reply:

Similar Artilces:

Help with : send "hello world" ASCII text to Linux serial port and read into a text file in java virtual machine...
Hello. Excuse the fact that I'm a newbie. I have a linux v 2.4 box with serial port something like ttyS0. I have a java VM running. I want to be able to pass the phrase"hello world" that is sent to the serial port with hyperterminal from a PC to a .java program running inside java virtual machine. I'm not sure if I'm on the right track with: FileInputStream, fis read() I guess the idea is to read 1 character at a time and build up a file like textfile.txt I can only use printable characters. Maybe I need some flags like: start_of_text and end_of_text are needed? I just want to able to read the text file after it has been sent, and the "hello world" is now there! Any help with this would be greatly appreciated!!! Thanks in advance. lang.help wrote: > Hello. Excuse the fact that I'm a newbie. > I have a linux v 2.4 box with serial port something like ttyS0. > I have a java VM running. > I want to be able to pass the phrase"hello world" that is sent to the > serial port with hyperterminal from a PC to a .java program running > inside java virtual machine. > I'm not sure if I'm on the right track with: > > FileInputStream, fis read() > I guess the idea is to read 1 character at a time and > build up a file like textfile.txt > > I can only use printable characters. > Maybe I need some flags like: start_of_text > and > end_of_text > are needed? > > I just want to...

Reading Text File, Text Scrolling and erase line from a text file
Hi , How can I Reading Text File, then Text Scrolling by means of keys "page UP" "page Down" and erase a specific line from a text file , when press "F2" key? Best Regards, Lidia from Poland -- ========================================= Pozdrawiam Lidiaa Lidiaa schrieb: > Hi , > > How can I Reading Text File, then Text Scrolling by means of > keys "page UP" "page Down" and erase a specific line from a text > file , when press "F2" key? > > ...

text + text
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =...

Help needed to retrieve text from a text-file using RegEx
Here is the scenario: It's a command line program. I ask user for a input string. Based on that input string I retrieve text from a text file. My text file looks like following Text-file: ------------- AbcManager=C:\source\code\Modules\Code-AbcManager\ AbcTest=C:\source\code\Modules\Code-AbcTest\ DecConnector=C:\source\code\Modules\Code-DecConnector\ GHIManager=C:\source\code\Modules\Code-GHIManager\ JKLConnector=C:\source\code\Modules\Code-JKLConnector ------------- So now if I run the program and user enters DecConnector Then I'm supposed to show them this text "C:\source\...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

Need help with strings, read text and writing text to file...
Hi all; I have writen a program to read in a list of filenmaes and to output javascript and html code. The resulting html code is then run thru a html to js program ( Easy HTML To Any Script Converter]. All this to display the pictures in a slideshow. The code did work at one stage... before I fully tested. But now I don't know whats gone wrong. As the html and javascript look right, as does the js code. There are three slide show, each with their own buttons... However some work, while others don't! #include <stdio.h> #include <string.h> #include <stdlib.h> #define FALSE 0 #define TRUE 1 #define LINESIZE 255 int setupoutfiles(char filename[], FILE **header, FILE **body) { char tempstr[LINESIZE]="\0"; strcpy(tempstr, filename); strcat(filename, "header.htm"); *header=fopen(filename, "w+"); if(!header) return -1; strcat(tempstr, "body.htm"); *body=fopen(tempstr, "w+"); if(!body) return -1; return 0; } int setupinfile(char filename[], FILE **infile) { *infile=fopen(filename, "r+"); if(!infile) return -1; return 0; } void therest(FILE **header, char b[]) { fprintf(*header, "\n%scounter=%sImages.length-1\n", b, b); fprintf(*header, "%si=0\n\n", b); fprintf(*header, "function %sfirst()\n", b); fprintf(*header, "{\n"); fprint...

ISQL is truncating contents of text field sent to text file.
Under SQL 2000 I have a table that consists of a single column of text type, each record holds about 15-25,000 chars. This data happens to be an xml, and I want to write this records to a text file. In order to accomplish this i'm using ISQL.exe, but i'm finding that some of the text type records aren't being written complete (truncated at 8k chars). I have tried increasing the width of columns (-w), and the maximum text size (-x) {the maximum length of text data to return} parameters for executing ISQL with no luck. High values make it crash. Problems: * If the data is longer t...

concatenating multiple text files into one text file
Hello all, I have a huge number of text files like : spectrum1_300_315.csv spectrum1_315_331.csv spectrum1_331_364.csv spectrum1_364_386.csv spectrum1_386_401.csv ...................................... ....................................... each file contains some headerlines at the beginning and data in 2 columns. I want to concatenate the data of the files into one text file .Can anyone hel me pls?thank u in advance. ...

Converting A Unicode Text File to An ASCII Text File
We have a large number of text files built in Unicode that we need to be read by SAS. SAS does not read Unicode text. To convert the Unicode text to ASCII text we did the following: A Unicode text file adds an additional blank space to each character. To remove this blank character, you can use the code below. The hexidecimal value '00' is a blank character. So remove it using the SAS statement '00'x. The 'x' tells SAS you are reading hexidecimal. Use RECFM=N to tell SAS that you are reading a stream of data that will not conform to a typical file structure. SAS will ...

Failed to write to a text file (text file is RW)
Hi, I dig up the following script. Added a simple HTML file with a form field named "vote" and have it send to the following php script. However, it failed to write to the poll_result.txt file. Why? Thanks as usual. <?php $vote = $_REQUEST['vote']; //get content of textfile $filename = "poll_result.txt"; $content = file($filename); //put content in array $array = explode("||", $content[0]); $yes = $array[0]; $no = $array[1]; if ($vote == 1) { $yes = $yes + 1; } if ($vote == 0) { $no = $no + 1; } // debug echo $yes; echo $no; // ou...

text file not mac text
please remind me of the difference. An 8-bit prog. I have needs ASCII text. if I save a file as TEXT or simpletext on a mac, it isnt accepted. I remember 'forked files' but no details...... Is there a II utilty to 'convert' a mac text file to acceptable II ascii text? thanks. cornelio <cornelio@san.rr.com> wrote: > please remind me of the difference. An 8-bit prog. I have needs ASCII > text. if I save a file as TEXT or simpletext on a mac, it isnt accepted. > I remember 'forked files' but no details...... > > Is there a II utilty to '...

Text in images to a text file
Hello, Does anyone know of any software for Linux which converts text in images to a text file. I have loads of paper documents that I intend to scan. The contents of these documents needs to eventually end up on a web site but as text. Darren <bobblebob@gmail.com> wrote in message news:1151612491.407262.124690@75g2000cwc.googlegroups.com > Does anyone know of any software for Linux which converts text in > images to a text file. I have loads of paper documents that I intend > to scan. The contents of these documents needs to eventually end up > on a web site but as text....

matrix and text to a text file
Hi, I know some similar question have been solved before but I have been reading for a while and I didn't find the answer of my question so, I ask you. I want to create a text-file (.txt) where I will have some text and some matrixs. The format that i want is something like that: -Title- Name1. Name2. power(dbm): big matrix (12000X400) aprox frequency(hz) vector(1x12) aprox So, i created a m-file that can do this writing with fprintf every single character on the file using lots of for loops. It works good but if the matrix is that size it could take a time (about 7 min...

Java HELP: How do you read in a Text File (Fixed Length)
I am very new to Java. How would you go about making Java program that reads in a fixed length text file (myfile.txt) and pass the data into a table in an sql table? The text file data looks something like this: 123456John Smith Acme Boxes Inc 100 Someplace Drive 222222Sarah E. ConnorCyberdyne Systems Corp 1 Connorsbane Plaza 333333Martin Fry Care Of: Joseph P Helstrom200 Hive Avenue Any help would be very appreciated. Harvey 1.if all rows and all data (IDno, Name, Company, Adress) are equal length then you can do it easily if you make a loop for1 to last IDno and ...

How to create help files / text files
I want to create a help dialogue that will just act as a reminder on do's & dont's I had in mind a text file with sliding bars but don't seem to be able to do this. The text will be about 300 words plus and it will be the same context in each record, any clues on how to do this? Ernie > I want to create a help dialogue that will just act as a reminder on do's > & dont's I had in mind a text file with sliding bars but don't seem to be > able to do this. > > The text will be about 300 words plus and it will be the same context in > each...

How to format a text file just like the RFC-text files?
I want to make some document go like these, what tools can help? Any help would be nice, thanks! BLIOGRAPHY ........................................... 34 APPENDIX A. EXAMPLES ............................................... 36 B. SIMPLE FIELD PARSING ................................... 40 C. DIFFERENCES FROM RFC #733 .............................. 41 D. ALPHABETICAL LISTING OF SYNTAX RULES ................... 44 August 13, 1982 - i - RFC #822 ^L Standard for ARPA Internet Text Messages PREFACE By 1977, the Arpanet employed several informal standards for the text messages (mail) sent among its host computers. It was felt necessary to codify these practices and provide for those features that seemed imminent. The result of that effort was Request for Comments (RFC) #733, "Standard for the Format of ARPA Network Text Message", by Crocker, Vittal, Pogran, and Henderson. The specification attempted to avoid major changes in existing software, while permitting several new features. The framework severely constrains document tone and appear- ance and is primarily useful for most intra-organization communi- cations and well-structured inter-organization communication. It also can be used for some types of inter-process commun...

help: reading plain-text foo.java files from IE
my internet cafe uses iMac's with OS 10.3.2, but I have trouble with IE. not sure if the problem is the OS or IE, or something else... http://www.geocities.com/cjavacjava/src/ecosystem5/ is where i'm mucking around. when click on foo.java a download manager pops up, which is unnecesary IMHO. windows and linux it just shows the document, since it's plain text. i don't want to save the file to the desktop, just view it from IE. how is that done, please? thanks, javac@mail.com ps: feel free to check out my foo.java source code, if you're so inclined :) javac@mail.c...

Read a non text file
How can i convert a weird looking file to text file. I know the main info is stored in the file which looks like below. "����<t���Jч�ĉTV��y�rr��Ph"e~Wm>�E�0Y'p�=C�&�rؙ�<t�Fx�Zo$�+T��=���H Or�r6�S��m&7<�p�q��� u����w}�jlꥎ+_�����Z�?��v��ȉ�XC R�}�_�׍�:�$)�o}��NʨW\&���I@b�#T�B��8���J��CL�ypr\�]R���p\��S�XRҏ�f&?/��� 2�t�_��x���bG���Z�D�v�s [�"��N�# Ѡ�@)�����h'&%�(�)��c�ͼA ���zUZjLRyu�P̤� ��� �W��e�@1'�(��u-nG��p��2_�� T&�6+� _� d�(1Z�E@���h�F�z �~x�fG���s�b�/-+�@��0�%��6�wu�=��z���Y�0...

Re: Converting A Unicode Text File to An ASCII Text File
Mike, SAS does not read Unicode text. It is not true encoding=utf8 exist HTH Andre I tried upon this contents (a french one saved in utf8) but showed here in windows Nom,Adressé "Bob","cité Bergère" "Ann","impasse Dôme" with this code under sas windows options validvarname=any; filename a "z:\utf8.csv" encoding=utf8; PROC IMPORT OUT= WORK.PAPER3 DATAFILE=a DBMS=CSV REPLACE; GETNAMES=YES; DATAROW=2; RUN; the results are Nom Adress� Bob cit� Berg�re Ann impasse D�me But perhaps you have another problem...

how can io dispaly the content of any file into the text area of jsp page
Hi All, In my project i want to dispaly the content of text/any fileinto the web page.if anybody how to this,then please tell me.Thanks in advance.regards mahesh mahesh wrote:...Sub: how can io dispaly the content of any file into the text area of jsppageIs that a question? Note the inclusion of '?' marks mywords as a question. It helps the reader to quickly scan text - looking for the relevant parts.> In my project i want to dispaly the content of text/any file>into the web page.<http://java.sun.com/products/jsp/tags/11/syntaxref1112.html>-- Andrew Thom...

How do I tell the difference between the end of a text file, and an empty line in a text file?
Python's lack of an EOF character is giving me a hard time. I've tried: ----- s = f.readline() while s: .. .. s = f.readline() -------- and ------- s = f.readline() while s != '' .. .. s = f.readline() ------- In both cases, the loop ends as soon it encounters an empty line in the file, i.e. xxxxxxxxxx xxxxxxxxxxx xxxxxxx < - - - loop end here xxxxxxxxxxxxxx xxxxxxxxxx x < ---- loop should end here walterbyrd wrote: > Python's lack of an EOF character is giving me a hard time. > > I've tried...

Reading a text file into a Matlab Matrix
Hello there, I have a text file that contains the following; word11 word12 word13 word14 word21 word22 word23 word24 word31 word32 word33 word34 I want to read it into a 3x4 matrix (each word in a separate cell) I tried to use; data = textread('fileName.txt', '%s', 'delimiter', '\n') - puts each line in one cell data = textread('fileName.txt', '%s', 'delimiter', ' ') - puts each word in one cell but in a 12x1 matrix/array [col1 col2 col3 col4] = textread('tE.txt', '%s %s %s %s', 'delimit...

Command for converting text file (Windows CR) to text file (Linux) ?
Assume I trasferred/uploaded a text file (which was created on a Win system) to Linux system. How can I convert the eol chars to the Linux style ? I opened (and later saved) it in vi editor. But this didn't help. What else can I do to convert it? Karl In article <475ef469$0$17522$9b4e6d93@newsspool4.arcor-online.net>, Karl Medrell <k.medrell@hotmail.com> wrote: >Assume I trasferred/uploaded a text file (which was created on a Win >system) to Linux system. > >How can I convert the eol chars to the Linux style ? > >I opened (and later saved) it in vi editor...

Deleting selected text from text area
I was wondering if anyone could help. I'm trying to find how to delete text from a selected text Area. I'm a beginner in Java Netbeans. So go easy! This is what I tried but its not happening. int start = 0, end = 1; while ( start < end ) { start = SpeechText.getSelectionStart(); end = SpeechText.getSelectionEnd(); if ( start != end ) remove( SpeechText.getText() ); } tom79l@googlemail.com wrote: > I was wondering if anyone could help. I'm trying to find how to > delete text from a selected text Area. > > I'm a beginn...

Web resources about - how to dispay a text file contents in a text area or label - comp.lang.java.help

Help:Contents - Wikipedia, the free encyclopedia
Templates are special pages that contain boilerplate text intended to be displayed on more than one page in Wikipedia. This Tip of the day box ...

Portal:Contents/Society and social sciences - Wikipedia, the free encyclopedia
A society is a group of people who form a semi-closed system . At its simplest, the term society refers to a large group of people sharing their ...

Seven and Google sign content deal
Seven West Media has signed a deal to have its content from shows such as My Kitchen Rules and Home and Away streamed on Google's online video ...

‘Google Posts’ allows certain people to post content directly to Google Search results
Google+ may not be the biggest success ever (and its recent redesign doesn’t seem to be doing it any favors), but Google’s apparently not done ...

SuperPhone and Apple's Future Content Strategy, Best Buy Is Betting on iPhone 7
... sales tool called SuperPhone . Upon closer examination, the ideas underpinning SuperPhone match what I suspect is Apple's long-term content ...

New York Magazine Building Out Branded Content Studio
... its stellar performance at the National Magazine Awards for editorial excellence, is in the process of building out an in-house branded content ...

Vimeo Redesigns iOS App to Make Content Discovery Easier
... optimized for iOS 9, and now offers picture-in-picture viewing. With this feature, users can watch a video while simultaneously browsing content ...

India To Appeal WTO Verdict On Domestic Solar Content Usage, Again
... of India’s National Solar Mission did not conform to international trade laws. [&hellip India To Appeal WTO Verdict On Domestic Solar Content ...

Ovation Brands Is Already Selling The Contents Of Buffets Closed On Sunday
... and proprietary items,” the auction notice says. Some things might have been carried off to other buffets, but the starting bid for the contents ...

Post ‘Spotlight’ Oscar And ‘The Revenant’, Anonymous Content Explores Minority Stake Sale
... Picture Oscar win for Spotlight , Best Picture nomination for The Revenant and Golden Globe win for Mr. Robot , Steve Golin ’s Anonymous Content ...

Resources last updated: 3/9/2016 1:44:12 PM