Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 15 Sep 2014, 23:10
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Java
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 4 [52 Posts]   Goto page: 1, 2, 3, 4 Next
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 28 Dec 2012, 03:12    Post subject:  Java
Subject description: Cross platform programming
 

I've been experimenting with java as a cross-platform language, and wrote a library database that works nicely on linux and windows with the latest Java JRE binaries (an easy download from Oracle does it). Run the files with "java -jar file.jar" I had to switch to OpenBox WM, since there's a conflict with JWM and java files.

Here's a library app to test. <Add> or <Remove> handles books on a clickable alphabetized list. Clicking an item writes the title and author into the entry boxes, and posts the original entry date. There's a button for getting the total number of books.

Data from the book class is written in XML format into the mlData folder, along with the book-list.

http://jpeters.net/apps/MyLibrary3.jar

Updated: Cut File size by a third; added publish info.
Updated: Streamlined code.

Updated: 4/4/13
All data now in one MyLibrary.xml file
Add author and title search buttons (repeated click gets next selection)
MyLibrary3.png
 Description   
 Filesize   15.71 KB
 Viewed   1603 Time(s)

MyLibrary3.png


Last edited by jpeps on Fri 05 Apr 2013, 03:52; edited 2 times in total
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sun 30 Dec 2012, 15:44    Post subject:  

Working jre: (updated)

http://www.jpeters.net/apps/jre1-7.0.13-001.sfs.tar.gz

ffde09235525e75dd8468741cc361123

Last edited by jpeps on Fri 08 Feb 2013, 04:35; edited 3 times in total
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Thu 03 Jan 2013, 00:11    Post subject:  

I was able to knock 63% off use of RAM with -Xmxn option (n=size). 2m is minimum.

example: in ROX, set run action to:
java -Xmx2m -jar "$@"
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sat 05 Jan 2013, 03:46    Post subject:  

Here's a text editor I built that sorts alphanumerically or by line size to a "sort.txt" file. This one's only 8K. Create and save a new list from within the editor, or just copy over the file.

Updated: includes open, save as dialogs. Closing with exit button records last file, which opens on next session.
Updated: includes a line number sort.
SortEditor.png
 Description   
 Filesize   10.08 KB
 Viewed   1404 Time(s)

SortEditor.png

SortEditor.tar.gz
Description 
gz

 Download 
Filename  SortEditor.tar.gz 
Filesize  12.25 KB 
Downloaded  487 Time(s) 

Last edited by jpeps on Fri 18 Jan 2013, 02:27; edited 2 times in total
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sun 06 Jan 2013, 15:05    Post subject:  

Updated the sort editor with open file and save as dialogues. It's still about 12K, and runs fast even on my old dell. Also, it runs on everything I tested it on. I'm definitely rethinking the whole java thing.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5028
Location: Arizona, U.S.A.

PostPosted: Sun 06 Jan 2013, 18:35    Post subject:  

Yep, that`s what drew me to it many years ago.
And it ( like C ) does very well in the portability department.

I was dismayed by the long learning curve, but it`s much like C.
It needs a really good class browser that has many search methods.

The other thing is... Does it compile to binary ( can`t remember ).

### The thought that I had...
Android is nearly a tablet + desktop O.S. ( amigo called it an interface ).
I`m thinking that making it desktop capable would kill Linux and Weeners.
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sun 06 Jan 2013, 20:29    Post subject:  

sunburnt wrote:


I was dismayed by the long learning curve, but it`s much like C.
It needs a really good class browser that has many search methods.


There are great tools like Eclipse that make it quite easy. Eclipse will offer suggestions and insert code for you as you program. There's also a ton of help on the internet.

Quote:


The other thing is... Does it compile to binary ( can`t remember ).


Yes...it writes "bytecode" to the Java Virtual Machine

Quote:

### The thought that I had...
Android is nearly a tablet + desktop O.S. ( amigo called it an interface ).
I`m thinking that making it desktop capable would kill Linux and Weeners.


Interface, as in extension vs replacement sounds correct. The JVM still doesn't exploit the individual computer's hardware (graphic card, etc) very efficiently. There's currently lots of development going on, so things should only improve. For programmers, it's a tool you can really sink your teeth into.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Sun 13 Jan 2013, 20:02    Post subject:  

jpeps,

What's the conflict with jwm? Joe is currently working on jwm and has written some java stuff too, so he should be able to fix it.

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sun 13 Jan 2013, 21:01    Post subject:  

01micko wrote:
jpeps,

What's the conflict with jwm? Joe is currently working on jwm and has written some java stuff too, so he should be able to fix it.


Text entry loses focus, and you can't get it back.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Sun 13 Jan 2013, 21:52    Post subject:  

jpeps,

Do you mind trying the latest version and see if it continues? You'll have to compile it. http://joewing.net/projects/jwm/snapshots/jwm-652.tar.bz2 , direct link to source

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sun 13 Jan 2013, 23:36    Post subject:  

01micko wrote:
jpeps,

Do you mind trying the latest version and see if it continues? You'll have to compile it. http://joewing.net/projects/jwm/snapshots/jwm-652.tar.bz2 , direct link to source


Same issue with ver -652
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Sun 13 Jan 2013, 23:49    Post subject:  

Ok, I see it too, Even Joe's program (ShareBrowse.jar) doesn't work. I'm sure his geek pride will want that fixed.
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Mon 14 Jan 2013, 00:07    Post subject:  

01micko wrote:
Ok, I see it too, Even Joe's program (ShareBrowse.jar) doesn't work. I'm sure his geek pride will want that fixed.


Smile
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Mon 14 Jan 2013, 00:48    Post subject:  

jpeps wrote:
01micko wrote:
Ok, I see it too, Even Joe's program (ShareBrowse.jar) doesn't work. I'm sure his geek pride will want that fixed.


Smile
Reported. Wink
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Tue 15 Jan 2013, 18:43    Post subject:  

Fixed in JWM-653 Smile .. now I can try your programs Smile
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 4 [52 Posts]   Goto page: 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0925s ][ Queries: 13 (0.0230s) ][ GZIP on ]