Solved

text area

Posted on 2004-10-12
13
173 Views
Last Modified: 2010-03-31
Hi..
I need to know how to get text area to have a title in large font in the first line(centered)
then have a border of some sort horizontally.

then more text in normal font for a few lines ..then how to add a picture in the next line..then more text below the picture

I need an example please
thanks
0
Comment
Question by:Samooramad
  • 6
  • 5
  • 2
13 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 150 total points
ID: 12290607
You'd be better off with a JEditorPane + html
0
 
LVL 14

Assisted Solution

by:sudhakar_koundinya
sudhakar_koundinya earned 150 total points
ID: 12290679
try {
        String url = "some html.html";
        JEditorPane editorPane = new JEditorPane(url);
        editorPane.setEditable(false);
   
        JFrame frame = new JFrame();
        frame.getContentPane().add(editorPane, BorderLayout.CENTER);
        frame.setSize(width, height);
        frame.setVisible(true);
    } catch (IOException e) {
    }
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12290847
if you use this constructor

public JEditorPane(String type,
                   String text)


 try {
        String url = "some html.html";
        JEditorPane editorPane = new JEditorPane("text/html","<H1>Test</h1><br><h2>Test2</h2>");
        editorPane.setEditable(false);
   
        JFrame frame = new JFrame();
        frame.getContentPane().add(editorPane, BorderLayout.CENTER);
        frame.setSize(width, height);
        frame.setVisible(true);
    } catch (IOException e) {
    }
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12290884
<html><body><h3><center>Caption</center></h3><hr>alksjdlaksdlkajsld<img src="yourfile.jpg"></img>slkdjfslkdjfls</body></html>
0
 

Author Comment

by:Samooramad
ID: 12292611
where do I declare and use the editor pane?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12292685
Well that's a bit of a 'how long's a piece of string?' question ;-)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Samooramad
ID: 12292997
:) sorry CEHJ .. I must be tired..but I don't seem to get it (how to use the code posted)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12293057
Just put the String i posted into sudhakar's JEditorPane ctor and use the rest of his example
0
 

Author Comment

by:Samooramad
ID: 12293474
is
public JEditorPane(String type,String text)

supposed to be a class?
0
 

Author Comment

by:Samooramad
ID: 12293485
never mind..I just got it..I do need a break..I will get back to you tomorrow

thanks
0
 

Author Comment

by:Samooramad
ID: 12296130
hey CEHJ I got an error under the image file name that said: ) expected..
I had to remove: <img src="yourfile.jpg"></img>
to get rid of the error

also sudhakar, I had to change IOException to Exception because of another error
0
 

Author Comment

by:Samooramad
ID: 12317182
It works I just need to know how to add the image
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12339172
8-)

>>hey CEHJ I got an error ...

That doesn't tell us anything - please post it
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now