Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- public class test extends JFrame{
- JTextPane jtp;
- JScrollPane jsp;
- public test() {
- jtp = new JTextPane();
- jtp.setContentType("text/html");
- jsp = new JScrollPane(jtp);
- String html =
- "<HTML>" +
- "<STYLE>.right{float:right;}" +
- ".left{float:left;}" +
- "</STYLE>" +
- "<BOBY>" +
- "<span class='right'>Right aligned</span><span class='left'>Left aligned</span>" +
- "</BOBY>" +
- "</HTML>";
- jtp.setText(html);
- this.add(jsp);
- this.setSize(400,400);
- this.setVisible(true);
- }
- public static void main(String[] args) {
- new test();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement