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

 
 


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

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









Related Pages:
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 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
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.
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
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
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
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;"> <
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
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
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
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
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
Moving The Images
Moving The Images  How to moving multiple images in one frame using swings
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
Scroll in JPanel
static void main(String[] args) { Frame f = new Frame ("Demo"); JPanel p = new JPanel(); JButton b1 = new JButton("Button 1"); JButton b2 = new JButton("Button 2"); p.setBackground(Color.red); p.add(b1); p.add(b2); JScrollPane s = new
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
Images - BufferedImage
images that take a long time to create. You can create them once, then display them... of an existing component (eg, a JPanel), or by using a BufferedImage constructor, in which... Java NotesImages - BufferedImage The java.awt.image.BufferedImage class
JPanel - Drawing Area
Java: JPanel - Drawing Area   To use a JPanel for graphics   Define a new class that extends JPanel and define a paintComponent method...; Example of drawing panel drawing area.   Define a subclass of JPanel
images
images  code for displaying image in java swings
jsp images
jsp images  hi I had done a demo application using jsp. And i tried to display some images which is located in the server folder. It has done by using the IP address path of that image folder.. It has been success full in IE
Jpanel allignment
Jpanel allignment  i have two panels added one below anotehr. and i have a one button. when i clicked button. the first panel ara should... using gribaglayout or any layout. need quick reply. thanks in advance
JPanel - Container
Java: JPanel - Container   Learn how to use the JPanel Container in a Swing application.   Swing comes with many components. The JPanel is one... application.   In this example code you will learn many methods of JPanel class
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Images - ImageIcon
Java NotesImages - ImageIcon javax.swing.ImageIcon is used for images... complication of using ImageObserver. For a small number of small images from disk... images in your .jar file using NetBeans and ClassLoader Let's say you have
How to Set Transperent Background Image to Jpanel - Java Beginners
Background Image to Jpanel.  Hi Friend, Try the following code...); } }; area.setOpaque(false); JScrollPane sp = new JScrollPane( area ); frame.getContentPane().add( sp
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
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="
how to display a table and buttons in swings - Java Beginners
how to display a table and buttons in swings  Hi frends, Actually i want to display a table during runtime and at the same time i also want to add different buttons below this displayed table using swings.....please can any
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
images - Java Beginners
(); } public AddImageJButtons() { super("Using Add Image JButtons...("Java"); content.add(button1); ImageIcon cup = new ImageIcon("/home...); content.add(button2); JButton button3 = new JButton("Java", cup
Images in java
Images in java  how to handle images in java
displaying images created at runtime - Java Server Faces Questions
displaying images created at runtime  hello I am creating some images at "runtime" with an JSF application. I want this JSF application to display these images. But using only setURL displays nothing. do you have any
Show multiple identical rows into JTable from database
Show multiple identical rows into JTable from database In this tutorial, you will learn how to display the multiple rows from database to JTable. Here is an example that search the data from the database and show multiple identical
How to display images in jsp ffrom sqlserver2000 - JSP-Servlet
How to display images in jsp ffrom sqlserver2000   These code u sent is till not displaying the image in jsp from sqlserver2000. what table...(binary).   Hi friend, I am sending again code but i am using JDBC
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
all sequences to create jdbc and how can i use jtable to display a single columns or multiple columns
all sequences to create jdbc and how can i use jtable to display a single columns or multiple columns  i am 3rd year cs student in ethiopia. i have... Vector(); JPanel panel=new JPanel(); try{ Class.forName
Multiple buttons in struts using java script
Multiple buttons in struts using java script  Multiple buttons in struts using java script
Create Multiple Buttons
Create Multiple Buttons using Java Swing       In this section, you will learn how to create multiple buttons labeled with the letters from A to Z respectively. To display them, we

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.