Solved

text area

Posted on 2004-10-12
13
212 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

710 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