Article View: borland.public.jbuilder.java.language
Article #18421JComboBox display and JAR/ZIP files
From: Davide De Benedictis
Date: Sun, 28 Jun 1998 00:00
Date: Sun, 28 Jun 1998 00:00
69 lines
2688 bytes
2688 bytes
I substitute the choicecontrol in my application for layout problems
(heavy vs light).
Unfortunately thi new control don't let me see the dropped list of items inside.
I just see a gray rectangle without items.
In a little project, made just to test the componet, all worked fine.
I tried also to copy the code from it but nothing !
I made something like:
JComboBox jc = new JComboBox();
public Frame1()
{
try
{
jbInit();
validate();
setVisible(true);
for( int i = 0; i < 50 ; i ++ )
{
jc.addItem("Davide " + String.valueOf(i));
}
}
catch (Exception e)
{
e.printStackTrace();
}
The only thing different seems to be the layouts where lies the component.
It's the first time I'm using swing so ...
Another One Million Dollar Question is about storing files different from Class
file
inside the jar file. For example Gif files or INI files.
I thought to extract "on the fly" these files with the util.zip classes
but if a jar file is for definition a self contained archive
there will be an easier way.
When I deploy an application, JB2 put inside the jar or the zip file also the
Gif files
included with the project. Obviously with the deployed application,
within the jar file, JAVA doesn't find the archives.
Moreover, when I select an Imagename from the IDE It put the absolute path.
Now to solve the problem, before to deploy my applications, I change all the
absolute
path in the code to :
.//image.gif
then I deploy the Images in the same folder of the application, but outside the
jar or zip.
When I change the path to reltive JB2 has some difficulties to render the
texture in design mode...
Could seems a stupid question but I'm still receiving e-mails about this topic,
since (one year ago)
I posted the same question on the Java FAQ at SUN. So I guess is not only my
problem.
thank you in advance
-----------------------------------------------------------
Davide De Benedictis
Pegaso Srl
Via Asiago 9, 00195 Roma, Italy
tel +39 6 32.20.437 fax +39 6 37.00.454
email : pegaso@mclink.it
-----------------------------------------------------------
Technical Details
Message-ID:
<359574BE.14C028F5@mclink.it>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,316a23966a7ee408,start X-Google-Attributes: gidf74b3,public From: Davide De Benedictis <pegaso@mclink.it> Subject: JComboBox display and JAR/ZIP files Date: 1998/06/28 Message-ID: <359574BE.14C028F5@mclink.it> X-Deja-AN: 366926099 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: Pegaso Srl Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language