Solved

Java Applet corection

Posted on 2004-04-22
25
237 Views
Last Modified: 2010-03-31
I have created  Java Applet,  the sort of  http://www.alphatel.com/dbview.htm
It dont work, and I dont know why(there are some readme in mentioned website, but, nevertheless I can no find answers on some questions).
I got error: 'Error occured during read of properties C:\windows\Desktop\myDatabase\...\mp3.properties"

Its unclear, what extension should be mp3.properties file -in original dbview applet have PROPERTIES File extension .PRO(which is unknown for my Windows) My properties file has just the text extension, I dont know how get .pro extension.
Then,what should be correct properties file?(full set of values, short?)
I set the following:
LOCALE      : US

DATA_FILE_NAME      : mp3.txt
DATA_FILE_DELIMITER : SEMICOLON
DATA_FILE_ROW_COUNT : 6748

Column_1 : name=Artist

Column_2 : name=Album

Column_3 : name=Year

Column_4 : name=Size__mb; type=NUMBER

Column_5 : name=Mode

Column_6 : name=Kbps

Column_7 : name=Location

Column_8 : name=Time; type=NUMBER

Column_9 : name=Track; type=NUMBER

Column_10 : name=Style
-----------------------------------------------------
Or full?

LOCALE      : US

DATA_FILE_NAME      : mp3.txt
DATA_FILE_DELIMITER : SEMICOLON
DATA_FILE_ROW_COUNT : 6748

Column_1 : name=Artist

Column_2 : name=Album

Column_3 : name=Year

Column_4 : name=Size__mb; type=NUMBER

Column_5 : name=Mode

Column_6 : name=Kbps

Column_7 : name=Location

Column_8 : name=Time; type=NUMBER

Column_9 : name=Track; type=NUMBER

Column_10 : name=Style


TITLE      : mp3 View
ABOUT      : Alex Corp


LAYOUT_NAVIGATION_BUTTONS : YES
LAYOUT_SEARCH_BUTTONS         : YES
LAYOUT_ABOUT_BUTTON         : YES

TOOLTIP_SHOW_TOOLTIP            : YES
TOOLTIP_MOVE_TO_FIRST_ROW      : Move to first row
TOOLTIP_MOVE_TO_NEXT_ROW      : Move to next row
TOOLTIP_MOVE_TO_PREVIOUS_ROW    : Move to previous row
TOOLTIP_MOVE_TO_LAST_ROW      : Move to last row
TOOLTIP_SEARCH_FOR_KEYWORDS      : Search for keywords
TOOLTIP_SHOW_BY_CATEGORY      : Show by category
TOOLTIP_SHOW_ALL_ROWS            : Show all rows
TOOLTIP_ABOUT_DATABASE_APPLET   : About dbView Applet


ALIAS_ALL_ITEMS      : All items
-----------------------

Is there meaning the order of records?
Perpaps, if I do not specify the some value, there will be set default values?(what?)
Its unclear also what's role of type=NUMBER attribute, what this change for user?

Thanks


0
Comment
Question by:horizont
  • 9
  • 7
  • 6
  • +1
25 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10889755
If you're trying to read it using a File it won't allow it. You should read it (and the file should be in the applet's codebase) as follows

Properties props = new Properties();
props.load(getClass().getResourceAsStream("/x.pro");

The file extension is immaterial
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10889762
Typo

>>props.load(getClass().getResourceAsStream("/x.pro");

should be

props.load(getClass().getResourceAsStream("/x.pro"));
0
 

Author Comment

by:horizont
ID: 10890826
Not clear, sorry.. What I should modify in a properties file?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10890938
It's not necessarily what's in there that's the problem. Show me how you are loading the properties file
0
 

Author Comment

by:horizont
ID: 10891490
I tried 2 ways (both specified in description),

<html>
<head>
<title>
HTML Test Page
</title>
</head>
<body>
dbview will appear below in a Java enabled browser.<br>
<applet
  codebase = "."
  code     = "dbView.class"
  archive  = "dbview.jar"
  name     = "dbView"
  width    = "700"
  height   = "400"
  hspace   = "0"
  vspace   = "0"
  align    = "top"
>
<param name="properties" value="mp3.properties">
</applet>
</body>

or, a little differs:

<html>
<head>
<title>
HTML Test Page
</title>
</head>

<body>

<applet code= "dbView.class" archive= "dbView.jar" height="400" width="700" name="dbView">
<param name="properties" value="mp3.properties">
</applet>

</body>
</html>
</html>
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10891588
No, i'm talking about the applet code that reads the properties, not the html
0
 

Author Comment

by:horizont
ID: 10892083
Look at  http://www.alphatel.com/dbview.htm -all files are there and are taken therefrom(no source available)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10892792
>>I have created  Java Applet,  the sort of  http://www.alphatel.com/dbview.htm

This suggests to me that you wrote an applet yourself, like this one - is that not the case?
0
 

Author Comment

by:horizont
ID: 10893084
Thats no matter, i have asked HOW TO ADJUST THIS APPLET that it work. If you have no any ideas, just say: "I have no any idea about this".
0
 

Author Comment

by:horizont
ID: 10893094
Thanks for great help from Expert.
0
 
LVL 92

Expert Comment

by:objects
ID: 10894234
>  If you have no any ideas, just say: "I have no any idea about this".

i think he has a little trouble saying that :)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 92

Expert Comment

by:objects
ID: 10894243
where is your propreties file installed?
it should be on the web server (are u running this from a web server?)
0
 
LVL 92

Expert Comment

by:objects
ID: 10894260
it should be in a config directory under your jar.
0
 

Author Comment

by:horizont
ID: 10897691
I thought, that my question is simple enough, but now I see, that I have hurried..
What I ask is: I have configured Applet (see specified link) according to my needs. There is no source, as you can see.
I try applet on my local PC, not on webserver.

There is stipulated to configure only 3 files:

1. text data file.
2. html document that includes applet tag.
3. properties file -(dbview.properties)
Plus make folder structure as described.

Required files for running the dbview applet:
dbview.jar
/config/dbview.properties
/data/data.txt
/images/*.jpg (optional)

# The names data.txt and dbview.properties are all configurable

My files:
dbview.jar
/config/mp3.properties.txt
/data/mp3.txt
mp3.html

Applet should run, but it does not work.
0
 

Author Comment

by:horizont
ID: 10898717
I have found a mistake myself: I used a .txt file as properties file, instead of editing properties directly in .properties file which had correct extension. OK.

There was one small problem still: the the data(names) in last column(Style) are interpreted
incorrectly and after last word there are shown small squares.
I have checked database file and found, if some cells in last column is empty, then applet fills a cell with squares; if cells contain a word, squares are added to the end of a word.
How ho to fix this?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10903901
>>Thats no matter, i have asked HOW TO ADJUST THIS APPLET that it work

No you didn't. Maybe English is not your first language, but i can assure you the following

>>I have created  Java Applet,  the sort of  http://www.alphatel.com/dbview.htm

means 'i have written an applet'. If you need help configuring an applet that *somebody else* has written then say so.
0
 
LVL 92

Expert Comment

by:objects
ID: 10904210
> means 'i have written an applet'.

no you have implied that. created could mean many thing, such as created an instance of.
If you are unclear on things a far better approach would be to ask questions instead of making assumptions about the requirements and a solution.
You'll save everyones time that way.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10904244
>>If you are unclear on things a far better approach would be to ask questions

What - you mean like this one

>>This suggests to me that you wrote an applet yourself, like this one - is that not the case?


>>created could mean many thing, such as created an instance of.

No it couldn't. Quite apart from the that 'the sort of' also means 'not this one'

>>I have created  Java Applet,  the sort of  http://www.alphatel.com/dbview.htm

0
 
LVL 92

Expert Comment

by:objects
ID: 10904424
if something like *developed* had been used then you might be able to think they wrote the applet.
But really the url in the question made it pretty obvious they hadn't written the applet.

horizont,

Ask CS for a refund of your points :)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10904492
>>if something like *developed* had been used then you might be able to think they wrote the applet.

Yes


>>But really the url in the question made it pretty obvious they hadn't written the applet.

It doesn't when it's prefaced with 'the sort of'. To me that means 'i have written an applet that's like this one at...'
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10927700
I for one don't support a points refund. If the question is reframed properly, now we've established someone else created the applet and it's publicly available, i'll try to help.
0
 
LVL 92

Expert Comment

by:objects
ID: 10934418
then horizont should get a refund on this question and open a new one with wording that you can understand.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10966949
Closed, 50 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now