473,756 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using pictures from the jar?



I create the jar with my classes, pictures and some txt files. The
application is starting just fine if picture folder is out of the jar.
If the folder picture is in the jar I don't see the pictures on my buttons
and everywhere.
How to solve that problem?
Jul 17 '05 #1
1 4201
Dado wrote:

I create the jar with my classes, pictures and some txt files. The
application is starting just fine if picture folder is out of the jar.
If the folder picture is in the jar I don't see the pictures on my buttons
and everywhere.
How to solve that problem?


Its really easy, just within a class in your jar use:

java.net.URL url=this.getCla ss().getResourc e("/path/in/jar/image.gif");
Image image=(new ImageIcon(url)) .getImage();
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5467
by: Sven Steinacker | last post by:
Hi, XSLT files generated by Microsoft InfoPath applied to an applicable XML file produces quite decent HTML presentations. At least with Mozilla and, of course, IE 6.0 the results look the same as the original form in InfoPath. However, pictures which were included in an InfoPath form's RTF field before, are encoded in XHTML and embedded in the XML file as follows: <img style="WIDTH: 541px; HEIGHT: 330px" tabIndex="-1" height="330"...
6
1808
by: Nutshell | last post by:
Hi, I created a web page which contains table. I use table cells to display a picture using <img src>. The problem is that some pictures are not being fully displayed, only a quarter of the left side of the picutre is being dislplayed inside the table cell. I have already checked if this is perhaps the web server problem, but I determinated it is not. Could anyone help me with the idea what could be wrong or what should I check? Btw,...
4
3484
by: Doug van Vianen | last post by:
Hi, I have the following coding on a web page. It causes two pictures (pic1.jpg and pic2.jpg) to show, one above the other and then when one clicks on the top picture is squeezes to the left (as its width is reduced) to show the bottom picture. Then when the bottom picture is clicked the top picture expands to the right to cover the bottom picture again.
13
2199
by: gooze | last post by:
Hello I am working on an applicaion that shows several pictures on a webpage. These pictures are saved in a MySQL DB as BLOB. I noticed, that the web server suffers in its performance by printing the pictures. Let's say there are 20 pictures to show, there also are 20 queries to do. This is the way I am doing it up to now: index.php <?php
13
3276
by: Jim Carlock | last post by:
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I created an array already, and whereby, the HTML and Javascript currently used amount to about 14KB for each of four different pages, the PHP page I started working on is already over 35KB in size (most of it is server side processing creating the array...
1
4842
by: samcode3 | last post by:
Hi, I want to upload pictures in mysql database using blob. I have code to check the extension and sizes. But to store in mysql i have to upload the picture on server first. But if i upload the picture, i have to delete it asoon as the picture is loaded in mysql else there will be alot of unwanted pictures. Pls help how do i delete pictures on server using PHP. Also if u have simple code to upload pictures in mysql...i would be delighted to...
4
6671
by: public2 | last post by:
Hi. This is my first post, and is about an assignment I've at my college. An overall description: We have to make a function, with one argument, the URL. then we have to search the HTML code for any pictures, and to do that I will search for <img and src tags. All that I can, but then we have to save the pictures local on my harddrive, and make a collage with all the pictures in it. My hindrance right now is the saving part. For...
4
7254
by: Zeljko Bilandzija | last post by:
Hy, could someone help me in this: In design mode, i want to put pictures in database. I made column named pics, and its type as image. How can I put pictures or some address of these pictures in that column, or i maybe need to put pictures in Add_Data folder and make reference from there, or what I need to do? could someone explain me that process of putting at least one picture in database, I'm using Microsoft SQL Server 2005
3
4255
by: DNolan | last post by:
Hello, I was wondering if anyone could help me. I have an access form with tabbed pages on it. I would like the colour of the tab name to change when a user inputs information into the fields on the page, i.e when they start a new record all the tabbed pages have their name in black and when they input info into a page the font colour of the page name turns to red. This is so that they can easily see if any pages have not been updated.
0
9287
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10046
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9886
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.