diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2014-01-08 20:06:00 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2014-01-08 20:06:00 +0100 |
commit | 636f509299122d02087c6fd62e1e4a46dbd22026 (patch) | |
tree | 70e43efceeb5b00e7f19cdac8da44928bd2fb459 /tdejava/koala/test/simplebrowser/KSimpleBrowser.java | |
parent | 719b61750c08343f530068ed4127623aeac71cf0 (diff) | |
download | tdebindings-636f509299122d02087c6fd62e1e4a46dbd22026.tar.gz tdebindings-636f509299122d02087c6fd62e1e4a46dbd22026.zip |
Rename many classes to avoid conflicts with KDE
Diffstat (limited to 'tdejava/koala/test/simplebrowser/KSimpleBrowser.java')
-rw-r--r-- | tdejava/koala/test/simplebrowser/KSimpleBrowser.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tdejava/koala/test/simplebrowser/KSimpleBrowser.java b/tdejava/koala/test/simplebrowser/KSimpleBrowser.java new file mode 100644 index 00000000..83964a0f --- /dev/null +++ b/tdejava/koala/test/simplebrowser/KSimpleBrowser.java @@ -0,0 +1,65 @@ +import org.trinitydesktop.qt.*; +import org.trinitydesktop.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 TDEMainWindow + * @see TDEApplication + * @see TDEHTMLPart + * + * @author java translation Kenneth J. Pouncey, kjpou@hotmail.com + * @version 0.1 + */ + +public class KSimpleBrowser extends TDEMainWindow { + + + static final int URLLined = 1; + + TDEHTMLPart tdehtmlpart; + + public KSimpleBrowser (String name) { + + super(null,name,0); + + toolBar().insertLined( "", URLLined, SIGNAL("returnPressed()"), + this, SLOT ("slotNewURL()")); + + + toolBar().setItemAutoSized(URLLined); + + tdehtmlpart = new TDEHTMLPart(this); + tdehtmlpart.begin(); + + tdehtmlpart.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>"); + + tdehtmlpart.end(); + + setCaption("KDE 2 Development book example - KSimpleBrowser"); + + setCentralWidget(tdehtmlpart.view()); + + } + + public void slotNewURL () { + + tdehtmlpart.openURL(new KURL(this.toolBar().getLinedText(URLLined))) ; + } + + + static { + qtjava.initialize(); + tdejava.initialize(); + } + +} |