diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /kdejava/koala/test/simplebrowser/KSimpleBrowser.java | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdejava/koala/test/simplebrowser/KSimpleBrowser.java')
-rw-r--r-- | kdejava/koala/test/simplebrowser/KSimpleBrowser.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/kdejava/koala/test/simplebrowser/KSimpleBrowser.java b/kdejava/koala/test/simplebrowser/KSimpleBrowser.java new file mode 100644 index 00000000..714ed72a --- /dev/null +++ b/kdejava/koala/test/simplebrowser/KSimpleBrowser.java @@ -0,0 +1,65 @@ +import org.kde.qt.*; +import org.kde.koala.*; + +/** + * Class KSimpleBrowser is the main application window. + * + * Taken from KDE 2.0 Development book + * + * Rendering HTML Files + * + * A Simple Web Browser - A feature-limited Web Browser. + * + * @see KMainWindow + * @see KApplication + * @see KHTMLPart + * + * @author java translation Kenneth J. Pouncey, kjpou@hotmail.com + * @version 0.1 + */ + +public class KSimpleBrowser extends KMainWindow { + + + static final int URLLined = 1; + + KHTMLPart khtmlpart; + + public KSimpleBrowser (String name) { + + super(null,name,0); + + toolBar().insertLined( "", URLLined, SIGNAL("returnPressed()"), + this, SLOT ("slotNewURL()")); + + + toolBar().setItemAutoSized(URLLined); + + khtmlpart = new KHTMLPart(this); + khtmlpart.begin(); + + khtmlpart.write("<HTML><BODY><H1>KSimpleBrowser</H1>" + + "<P>To load a web page, type its URL in the line " + + "edit box and press enter,</P>" + + "</BODY></HTML>"); + + khtmlpart.end(); + + setCaption("KDE 2 Development book example - KSimpleBrowser"); + + setCentralWidget(khtmlpart.view()); + + } + + public void slotNewURL () { + + khtmlpart.openURL(new KURL(this.toolBar().getLinedText(URLLined))) ; + } + + + static { + qtjava.initialize(); + kdejava.initialize(); + } + +} |