Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

text area

Posted on 2004-10-12
13
Medium Priority
?
220 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

916 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