Solved

text area

Posted on 2004-10-12
13
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

628 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