Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Display Multiple Images in jscrollpane using Java Jpanel

Have Programming Question? Ask it here!
 
 
 


vaithiyanathan
Display Multiple Images in jscrollpane using Java Jpanel
1 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners


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


Advertisement
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);
    }
}


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 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
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 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
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 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
Displaying the same image in a JPanel and using scroll - HELP - Java Beginners
Displaying the same image in a JPanel and using scroll - HELP  I hope someone can help me out here. I want to display an image in a JPanel which... cannot see the images displayed using the scroll. import javax.swing.
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
code to display images using 2d array - Swing AWT
code to display images using 2d array  HI !! I have an image file in ascii/binary format (lines & pixels) in the form of a 2d-array. I would like to display this using java code. I am relatively new to coding
compareing images using java - Swing AWT
compareing images using java  hi can u please give me the code in java to compare imges..i have the program to get the pixel values using pixel... with another image,i.e,program to compare two images using the pixel values.. thank
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
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
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;"> <
Java: JPanel - Example
Java: JPanel - Example // Demo Application of use of JPanel for drawing. -- Fred Swartz // Modified from applet version 2001-09-09, 2002-02-07 import... ///////////////////////////////////////////////////////// DrawingArea class DrawingArea extends JPanel
Multiple buttons in struts using java script
Multiple buttons in struts using java script  Multiple buttons in struts using java script
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
resize image with the change in size of jpanel.. - Java Beginners
resize image with the change in size of jpanel..  hi.. i am try to insert image in jpanel in jform to give attractive look to application,but the of image do not changes if the size of jframe or jpanel changes. if there is any
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
Multiple inheritance using interface - Java Beginners
Multiple inheritance using interface  Hi, I understand.... But the use of the interface is when we use multiple inheritance with more than one... in multiple inheritance Thank you, Rajkanth  Hi Friend, Please
How to draw in jPanel? swing/graphics Java
How to draw in jPanel? swing/graphics Java  How to draw in jPanel? (swing/graphics Java
Draw a line in a JPanel with button click in Java
Draw a line in a JPanel with button click in Java  Draw a line in a JPanel with button click in Java
Displaying images using Javascript
to display images using javascript and css.For this we are going to make program named... Displaying images using Javascript...="images/arrow_left.gif">   <img id="
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
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
Animating Images in Java Application
Animating Images in Java Application   ... with multiple images. You can see how animation has been implemented in the following program or example. The given program implements the animation using more than one
How to create Multiple Frames using Java Swing
Multiple Frames in Java Swing In this section, you will learn how to create multiple frames. Java Swing provides the utility to show frame within another... display a JFrame-like window within another window. It provides many
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
display records with images problem - JSP-Servlet
display records with images problem  hello, i am developing HR application whereby i want to display employee records and their pictures on web..., Display images from database to visit ... http://www.roseindia.net/jsp
How to Add JComboBox on JPanel - Java Beginners
How to Add JComboBox on JPanel  How to Add JComboBox on JPanel D:\java>javac ViewElements.java ViewElements.java:181: expected...(){ JFrame f = new JFrame("Frame in Java Swing"); f.getContentPane().setLayout(null
how to re size image proportionately using java for different images like jpeg, png, gif.
how to re size image proportionately using java for different images like jpeg, png, gif.  hi, i need sample code for re size image proportionately using java for different images like jpeg, png, gif, this code for my
scrollbar in JPanel
scrollbar in JPanel  Scroll bar is not working when i am using... f = new Frame ("Demo");JPanel p = new JPanel();JButton b1 = new...(100,150,150,20);p.add(b1);p.add(b2);JScrollPane s = new JScrollPane(p
multiple JComboBoxes using with JDBC
multiple JComboBoxes using with JDBC  how to use JComboBoxes...(){JFrame f = new JFrame("Frame in Java Swing");JLabel label1=new...){ } JPanel p=new JPanel(new GridLayout(2,2)); p.add(label1); p.add(jc1); p.add
read XML file and display it using java servlets
read XML file and display it using java servlets  sir, i can't access Xml which is present in my d drive plz can u should go through my code n tell me the things where i went wrong java servlet program protected void
how to upload and download images using buttons in jsp?
how to upload and download images using buttons in jsp?  how to upload and download images using buttons in jsp
how to save images in oracle using JSP
how to save images in oracle using JSP  how to insert images in oracle using jsp
how to save images in oracle using JSP
how to save images in oracle using JSP  how to insert images in oracle using jsp
java mail sending with images
java mail sending with images  I need to send images through java mail without giving content path(i.e. we don't want hard code the image path)can you tell me the idea?   Please visit the following links: http
 

 

 

DMCA.com