Pander Musubi

Greenhorn
+ Follow
since May 15, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Pander Musubi

I am looking for a KDE look and feel (or make one myself) because I am finding myself using too much statements UIManaget statements like:

UIManager.put("Button.background", SystemColor.control);
UIManager.put("ToggleButton.background", SystemColor.control);
...

String aIconBasePath = "/usr/share/icons/crystalsvg/";

UIManager.put("OptionPane.errorIcon", getImageIcon(aIconBasePath + "32x32/actions/messagebox_critical.png"));
UIManager.put("OptionPane.warningIcon", getImageIcon(aIconBasePath + "32x32/actions/messagebox_warning.png"));
...

UIManager.put("FileChooser.newFolderIcon", getImageIcon(aIconBasePath + "22x22/actions/folder_new.png"));
...

This is because UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); on Linux is still having this Metal look and feel.

Has anyways already a working KDE look and feel? Or interested in making one?
18 years ago
I generate a jar with ant but it will not use the class-path specified in the manifest file. However, when I extract the jar and package it again manually it works ok. How do I fix my ant so it works directly?

ant file:

...
<path id='lib.path'>
<fileset dir='lib/'>
<include name='*.jar'/>
</fileset>
</path>

<pathconvert property='lib.path.manifest' pathsep=' '>
<path refid='lib.path'/>
<chainedmapper>
<flattenmapper/>
<globmapper from='*' to='lib/*'/>
</chainedmapper>
</pathconvert>
...
<target name='dist' depends='build' description='make distribution'>
<copy file='README' todir='build'/>
<copy file='LICENSE' todir='build'/>
<copy file='ChangeLog' todir='build'/>
<copy todir='build/lib'>
<fileset dir='lib'/>
</copy>
<mkdir dir='dist'/>
<jar jarfile='dist/${name}-${version}.jar' basedir='build'>
<manifest>
<attribute name='Built-By' value='Pander'/>
<attribute name='Class-Path' value='${lib.path.manifest}'/>
<attribute name='Main-Class' value='com.svg.${name}.${Name}'/>
</manifest>
</jar>
<checksum file='dist/${name}-${version}.jar' forceOverwrite='yes'/>
</target>

<target name='run'>
<java jar='dist/${name}-${version}.jar' fork='true'/>
</target>
...

The resulting manifest in the generated jar is:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: Blackdown-1.4.2-02 (Blackdown Java-Linux Team)
Built-By: Pander
Main-Class: com.svg.vault.Vault
Class-Path: lib/BrowserLauncher2.jar

but "ant run" or "java -jar bla.jar" will abort on being unable to find classes of lib/BrowserLauncher2.jar

but if I unjar the file and create a new jar with
jar mcf specifying the manifest and the contents of the just extracted jar, the new jar will work with "java -jar bla.jar"

How can I fix this so that the jar generated by ant works with java -jar ?
18 years ago
No it is when a server name has been specified but actually no server is running. If you are really interested in this strage error I can send you my submission. Gonna submit it in a few days anyways and in my view it it finished. Can also send it or a part of it after the real submission when I have more time.
fixed it by changing part of my design
Well I just ran into problem because Sun (Netherlands) told me that I only needed to submit the assignment and have to reserve for an exam before the voucher expires. This is NOT correct, this is very old info!
Prometric told me to submit AND do the test before the voucher exipers. They also told me that if you fail you can bye a new voucher and simply do the test again with the same/identical assignemt.
Do others think this info is correct? Anyways, if in doubt, please call you local testing organisation and/or Sun.
It is also not in my assignment to keep track of who is locking. I think the locking doesn't need to know what client has got/put in what lock, correct?
Other question, a search/refresh/update does to look at any write locks which are there, correct?
Hi all, I've the old Fly By Night assignment and have a problem with my locking and almost have to submit the assignment and time is running out, aaaaagh!
When two different clients try to book some seats on the same flight (record number 2), one doensn't book.
This is part of my code and I can't figure out whats wrong. Clients do not lock, only the very first request is succesfuly booked. Here si the code with some debug lines so you can uderstand the output below.

(In method modify I have the the thread sleep for 5 secs so I can test the locking, when this is over you will see the "modify end sleep")
And this is the result
inside update 2
a inside lock 2
d about to add 2
e leaving lock 2: [2]
about to modify update 2
inside modify
inside update 2
end sleep modify
about to unlock in update 2
UNLOCK about to remove 2 [2]
UNLOCK removed 2 []
a inside lock 2
d about to add 2
e leaving lock 2: [2]
about to modify update 2
inside modify
end sleep modify
about to unlock in update 2
UNLOCK about to remove 2 [2]
UNLOCK removed 2 []
So if for flight with record number 2, a first request is made for 3 seats and inmediately after that a request for same flight for 7 seats, only 3 seats are being booked.
Any help is very welcome. Thanks.
Sorry to get you all confused.
I have a dialog which contains a JFileChooser AND some fields for selecting a remote server. So the user can choose what he or she wants. so the file choose is not used for selecting the remote server. Don't worry. Although when the remote server is not avaiable the whole thing crashes on the file chooser as described above.
Thanks,
P.
These requirements are not in my assignment, i think i have still an old assignment.
Anyways, trying to access anything on the disc after it fails to connect to rmi registry fails, even when I don't use a JFilCchooser and set the path hard in my code.
So my sollution is that this wierd behaviour of after "Connection refused to host" is to simply stop the program. Gonna document it and leave it at that. Think that is the most efficient sollution at this time.
I'll think I'l just get rid of the JFileChooser all together. It's not in the requirements. Just pass the file name as args[0] and have the user choose between that and remote server.
Makes it more safe so user cannot go browsing around the entire system with the file chooser.
Are there more people that also submit command line args to the client appl? like optionally default RMI hostname and optionally default port?
P.
Hi all,
I have a dialog for selecting a file or a remote server, it has a JFileChooser which displays the contents of directory data which is in the current directory.
I was testing my error handling for when I don't have an RMI registry running. Then it displays a message box with an error and should create new JFileChooser but cannot do this anymore. Even reusing the existing JFileChooser doesn't work anymore!
Note that is has problems with my home dir / desktop dir althoug i'm not running it from that dir. Is this a Java bug?
Exception in thread "main" java.security.AccessControlException: access denied (
java.io.FilePermission C:\Documents and Settings\XXXXX\Desktop read)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:270)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
at java.io.File.exists(File.java:677)
at sun.awt.shell.ShellFolder.exists(ShellFolder.java:257)
at javax.swing.filechooser.FileSystemView.getSystemDisplayName(FileSyste
mView.java:140)
at javax.swing.plaf.basic.BasicFileChooserUI$BasicFileView.getName(Basic
FileChooserUI.java:1023)
at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(MetalFile
ChooserUI.java:216)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserU
I.java:130)
at javax.swing.plaf.metal.MetalFileChooserUI.installUI(MetalFileChooserU
I.java:152)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.JFileChooser.updateUI(JFileChooser.java:1700)
at javax.swing.JFileChooser.setup(JFileChooser.java:345)
at javax.swing.JFileChooser.<init>(JFileChooser.java:320)
at javax.swing.JFileChooser.<init>(JFileChooser.java:303)
at suncertify.client.Gui.selectDatabaseDialog(Gui.java:271)
at suncertify.client.Gui.<init>(Gui.java:38)
at suncertify.client.Gui.main(Gui.java:366)
My assignment doesn't talk about it, it even states that is is allowed to used security manager policy file as command line argument. But of course it is important to tell why you choose for this or that. Thanks for your replies.
These are my policy files. I think these are as minimalistic as it can get. My question is, they aren't too restricting are they? Application works fine with it.
policy server side
grant {
permission java.io.FilePermission "*", "read,write";
permission java.net.SocketPermission "*:1024-65535", "connect,accept";
};
policy client side
grant {
permission java.net.SocketPermission "*:1024-65535", "connect";
};
Hi all,
Objects of Data can throw DatabaseException, but via RMI Remote exceptions are thrown. I combined these by having DatabaseException extend RemoteException and have methods catch or throw DatabaseExceptions and at the same time (when RMI is being used) also handling the RemoteExceptions.
By passing the exceptions on really easy and catch them all in one place and still see where they originate from. Is this approach been used by others? Is there any criticism on combining the exceptions like this?
Regards,
Pander
Hi all,
Do all of you keep the suncertify(.db.*) name for the main package and application or do you change it to the name of the application. E.g. BookFlight and package name bookflight(.db.*)
Thanks,
P.