Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

text area

Posted on 2004-10-12
13
Medium Priority
?
217 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 450 total points
ID: 12290607
You'd be better off with a JEditorPane + html
0
 
LVL 14

Assisted Solution

by:sudhakar_koundinya
sudhakar_koundinya earned 450 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

688 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