Display Multiple Images in jscrollpane using Java Jpanel

Ads
 

Display Multiple Images in jscrollpane using Java Jpanel

Browse and Display multiple images in vertical view of java jscrollpane using jpanel.

View Answers

March 21, 2012 at 10:48 AM

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

class  DisplayMultipleImages
{
    public static void main(String[] args) 
    {
        JFrame f=new JFrame();
        JPanel p=new JPanel();
        p.setLayout(null);
        JLabel lab1=new JLabel();
        JLabel lab2=new JLabel();
        JLabel lab3=new JLabel();
        JLabel lab4=new JLabel();

        ImageIcon icon1=new ImageIcon("c:/rose1.jpg");
        ImageIcon icon2=new ImageIcon("c:/rose2.jpg");
        ImageIcon icon3=new ImageIcon("c:/rose3.jpg");
        ImageIcon icon4=new ImageIcon("c:/rose4.jpg");

        lab1.setIcon(icon1);
        lab2.setIcon(icon2);
        lab3.setIcon(icon3);
        lab4.setIcon(icon4);

        lab1.setBounds(10,10,250,400);
        lab2.setBounds(250,10,250,400);
        lab3.setBounds(500,10,250,400);
        lab4.setBounds(750,10,250,400);

        p.add(lab1);
        p.add(lab2);
        p.add(lab3);
        p.add(lab4);
        f.add(p);
        f.setVisible(true);
        f.setSize(1000,400);
    }
}

Ads









Related Tutorials/Questions & Answers:
Display Multiple Images in jscrollpane using Java Jpanel
Display Multiple Images in jscrollpane using Java Jpanel  Browse and Display multiple images in vertical view of java jscrollpane using jpanel
how to show set of images continously using JScrollpane in java
how to show set of images continously using JScrollpane in java  how to show set of images continously using JScrollpane in java
Advertisements
how to show set of images continously using JScrollpane in java
how to show set of images continously using JScrollpane in java  how to show set of images continously using JScrollpane in java
how to display multiple images on browser
how to display multiple images on browser  i want to display multiple images on brower including string values from sql database using jsp
how to display multiple images on browser
how to display multiple images on browser  i want to display multiple images on brower including string values from sql database using jsp
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...;COLLEGE INFORMATION :</legend> <pre> Gallery Images: <input type
display multiple images from postgres database in jframe
display multiple images from postgres database in jframe  i just want to display multiple images on jframe by firing a query on postgres database
How to display multiple images in jsp
How to display multiple images in jsp  <%@ page import="java.io....()); System.out.println("st-7 "+brr); // display the image response.setContentType("image... "); } } catch (Exception e) { out.println("Unable To Display image"); out.println
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array  i am using netbeans 7.0 ,with struts 1.3.8 and i want to insert multiple images in mysql database ,with use
how to scroll multiple images using on Click in Android
how to scroll multiple images using on Click in Android  I am new... there is requirement like multiple image scrolling dynamically. But unfortunately i am unable to scroll multiple images. But i am able to scroll single image. plz let me know
How to store multiple images in folder and images path in database at a time using jsp?
How to store multiple images in folder and images path in database at a time using jsp?  I wanna browse multiple images in one form and store them in one folder and their path into datrabase
java program to read multiple files from a directory and display them on a jframe
java program to read multiple files from a directory and display them on a jframe  hi guys i want to write a java program that will read all files in a directory and display them one by on on a jframe on jpanel with specific key
Storing Multiple image in sql using java
Storing Multiple image in sql using java  Hi, How to store and retrieve a multiple image in sql using java but already i have created sql table if i want to insert a image while runtime execution. Can anyone tell me solution
Draw bufferimage in jpanel using netbeans
Draw bufferimage in jpanel using netbeans  please i need urgent help. i have form which contains some fields generated in netbeans. how can i draw bufferimage in Jpanel that is inside the form. thanks
Merge multiple jasper file to one word Doc using java
Merge multiple jasper file to one word Doc using java   how to Merge multiple jasper file to one word Doc using java
how can i achieve multiple inheritance in java without using inheritance ?
how can i achieve multiple inheritance in java without using inheritance ?  how can i achieve multiple inheritance in java without using inheritance
Images in java
Images in java  how to handle images in java
pint multiple images from blob database
pint multiple images from blob database  How to display multiple images using blob from mysql database. The program code is as below: <TABLE cellpadding="15" border="1" style="background-color: #ffffcc;"> <
Using HeaderFooter class of iText API , Can we display multiple phrases in the footer section of PDF ,each with different alignment.
Using HeaderFooter class of iText API , Can we display multiple phrases in the footer section of PDF ,each with different alignment.  Hi, I have a similar question related to HeaderFooter class, I want to display three Phrases
Display tow dimensional array using one for loop in java
Display tow dimensional array using one for loop in java  Display tow dimensional array using one for loop in java
write a java pogram to add elements to linked list using keyboard and display it
write a java pogram to add elements to linked list using keyboard and display it  write a java pogram to add elements to linked list using keyboard and display
Write a java program to display the season given the month using switch case
Write a java program to display the season given the month using switch case  Write a java program to display the season given the month using switch case
Problem with display of images in applets - Applet
Problem with display of images in applets  Hi all, When I run..., this); } } --------------------------------------- Display image in Java Applet... using the netbeans IDE 5.0. Blue hills.jpg is present in both the src folder

Ads