I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this

I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this

Can Anyone Help Me In This

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

class SlideShow extends JFrame implements ActionListener { int img=1; JPanel jp1,jp2; JButton jb1,jb2;

SlideShow()
{
    setVisible(true);
    setSize(650,650);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLocationRelativeTo(null);

    Container con=this.getContentPane();

    jp1=new JPanel();
    jp1.setLayout(new FlowLayout());

    jb1=new JButton(">>");
    jb1.setToolTipText("Next");
    jb1.addActionListener(this);
    jp1.add(jb1);

    jb2=new JButton("<<");
    jb2.setToolTipText("Previous");
    jb2.addActionListener(this);
    jp1.add(jb2);

    jp2=new JPanel();
    jp2.setLayout(new FlowLayout());

    con.add(jp1,BorderLayout.SOUTH);
    con.add(jp2,BorderLayout.NORTH);
}


public void actionPerformed(ActionEvent ae)
{
    if (ae.getSource()==jb1)
    {
        img++;
        repaint();          
        if (img>4)
        {
            img=1;
        }
    }
    else if (ae.getSource()==jb2)
    {
        img--;
        repaint();
        if (img<1)
        {
            img=4;
        }
    }
}


public void paint(Graphics g)
{
    Color myColor = new Color(150,250,150);

    ImageIcon im=new ImageIcon(img+".jpg");
    JLabel l=new JLabel(im);

    //l.setOpaque(true);
    l.setBackground(myColor);

    jp2.add(l,BorderLayout.CENTER);

    jp2.validate();
    jp2.repaint();
}

public static void main(String[] args) 
{
    new SlideShow();
}

}

View Answers









Related Tutorials/Questions & Answers:
I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this
I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this  Can Anyone Help Me In This import java.awt.*; import javax.swing.*; import java.awt.event.*; class SlideShow
Any one can help me? - Java Beginners
Any one can help me?  CAN any of u help me to do this java codes for the interface given below? thanku the user will be given jumbled words.... If the player is able to arrange all the words without any mistake, he/she can get
Advertisements
hi , i cant make this programmer , can any one help me to make it pls - Java Beginners
hi , i cant make this programmer , can any one help me to make it pls  ... program. i cant find delete records or update records  pls can... ? -Update record(s)? -Delete record(s)? -Make one copy of a specific text file
please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  Q 1) In a class first day 25 students are joined. After two days that total students will increased to 60. We can develop a program by using ArrayList concept
actually i want to knw how to include an google page inside a tab(suppose in 2nd tab).can any one help me....
how to include an google page inside a tab(suppose in 2nd tab).can any one help me....  actually i want to knw how to include an google page inside a tab(suppose in 2nd tab).can any one help me
please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  1) Copy one file content to other? 2) Count the number of words in a file
could any one help me?
could any one help me?  I'm a student in the faculty of computer and information science we will make graduation project "taxi dispatcher" we need... exist in mobile to our server I want to know which programming language shall I
plz help me any one as fast as u can
plz help me any one as fast as u can  A thief Muthhooswamy planned... is the number of metres he can jump (1<=climbUp<=10^10) climbDown... Sample Input 1: 10:1:1:{10} Here Muthooswamy can jump 10 metres height
how to highlight the field in image,when i have entered into that corresponding field's textbox-any one help out
how to highlight the field in image,when i have entered into that corresponding field's textbox-any one help out  how to highlight the field in image,when i have entered into that corresponding field's textbox. Here webpage
Hii i want a JMS application can anybody help me
Hii i want a JMS application can anybody help me  jms application
what timing attack {practically}??? any one can help me in my Ph.d thesis
what timing attack {practically}??? any one can help me in my Ph.d thesis  Respected sir/mam, I have search out from each journal but i could... give me only practical overview of this concept.You can send me your programming
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone  The Airport Valet Parking Company (AVP) is a company which... and time for the collection of their car at the airport and also for its delivery
any one help me in alfresco technology - Development process
any one help me in alfresco technology  i am sending some questions in alfresco,but no one is give the answer. i want webscript materials and JSON materials.please any body can u responding my questions.  Hi friend
servlet not working properly ...pls help me out....its really urgent
servlet not working properly ...pls help me out....its really urgent  ... of b-e(1).jsp , 4)**b-e(1).jsp** Hre radio buttons are also used and i dont know whether i used the correct method to display the data from database via
i want to retriev and update in same form but its not working pls help....
i want to retriev and update in same form but its not working pls help.... ...;<head> &lt;TITLE>view particular applicants application...;h2><b><u>VIEW PARTICULAR APPLICANTS APPLICATION DETAILS</u>
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...   ...," Album is Full you can not push the image ."); else top=top+1; aray[top]=item
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..
help me for java coding i will grateful..   i want to convert a image file to its byte code format that help me for the pattern matching in my project.. but i cant convert Image file to its byte code format.. if anybody can plz
this is my javascript code and i am not understanding the mistake in this,please help me?
this is my javascript code and i am not understanding the mistake in this,please help me?  <html> <h2>Form Validation</h2> <script language = "Javascript"> function checkEmail
Ple help me its very urgent
Ple help me its very urgent  Hi.. I have one string 1)'2,3,4' i want do like this '2','3','4' ple help me very urgent
autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me
autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me   Hi have develop the jsp to populate... bird names , but whenever i selected any bird in the text filed the am getting
can any one explain this
can any one explain this  class Clidder { private final void flipper() { System.out.println("Clidder"); } } public class Ex3 extends Clidder { public final void flipper() { System.out.println
pls help me sir its urgent
pls help me sir its urgent  thanks for reply, but i am getting this error pls help me its urgent type Exception report message description The server encountered an internal error () that prevented it from
Can someone help me with this?
Can someone help me with this?  I have this project and i dont know how to do it. Can someone help me? please? Write a java class named "PAMA..., Multiply, Divide) Help me please! Thanks in advance!   import
its very urgent please help me
its very urgent please help me  how can i retrieve all images from ms access database and display in jsp pages
Java- Save Image into project folder in web application
want to save the image..when I am trying to create empty folder and get the absolute path of that I am getting eclipse path... can any one please help me...Java- Save Image into project folder in web application  I have
How can I get experience in data science if no one would hire me?
How can I get experience in data science if no one would hire me?  Hi... for the tutorials to learn: How can I get experience in data science if no one would hire me? Try to provide me good examples or tutorials links so that I can
I am trying to create domains for column attributes of my data dictionary?
I am trying to create domains for column attributes of my data dictionary?  Please provide me with the best possible solution. I already have the fields and there data types in a table and then the field values in another table
Please help me... its very urgent
Please help me... its very urgent  Please send me a java code to check whether INNODB is installed in mysql... If it is there, then we need to calculate the number of disks used by mysql
i am confused here on what to write can some 1 help out here - Java Beginners
i am confused here on what to write can some 1 help out here  i don't quite understand how to code it so can some one help out
please help me solve this problem when i am create database connection using servlecontext
please help me solve this problem when i am create database connection using servlecontext  hi... I have create a database connection using servletcontext . in this code when i login first time it will exceute sucessfully
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me   displaying List... ?? its urgent can u help me
Problem In applet Its run on browser but hang and blinking when image is draging some where.
what I am trying to say. please help me ASAP... is draging some where.  I am Created applet in working properly on browser... draging one card, applet is refreshing and blinking continue when I am moving
unable to display image using html tag in servlet.(image src is in a variable.....). i am using netbeans IDE. plz..........do help
unable to display image using html tag in servlet.(image src is in a variable.....). i am using netbeans IDE. plz..........do help  import...(); upb.setFolderstore("E:/College/BE/Semester II/NetBeansProjs/image_store/web
Can you help me with applet?
Can you help me with applet?  I'm very new to applet, and i'm weak in graphic design part. How can i add the graphic in my test project? Can you help me with this: import java.io.*; import java.util.*; import javax.swing.
Not sure what I am missing ? Any ideas?
Not sure what I am missing ? Any ideas?  import java.util.*; public...) { if(str.length()==0) return false; for(int i=0;i<str.length();i++) if (c==str.charAt(i)); return true
do the combinations in java, pls help me its urhent - Development process
do the combinations in java, pls help me its urhent  import... or condition5) ") p.evaluate(); } } i need the ouput as follows can any one help me: action when condition1 and condition3 action when condition1
A few questions related to developing a blog....can anyone please help me out??
A few questions related to developing a blog....can anyone please help me out??  I am trying to develop a project which is almost like a blog using jsp.I have a few questions.... Can anyone tell me if we can insert images
PLZ HELP ME. i need php code.
PLZ HELP ME. i need php code.   I want php code for bellow OUTPUT. output is just example but it must be letters only. abc bcd efg jku rgt azs hje qqc wws adt
Need to develop a control panel for application form which is developed in jsp
to display and hide some check boxes,radio buttons and text boxes. I am not getting any idea to develop it..Can any one help me..In order to develop... in jsp  I have created one application page which contains some check boxes
I wanted do develop mini application With server request and tesponse
I wanted do develop mini application With server request and tesponse  I m planning to develop the mini webapplication using struts 1.2.9... and response. Any body could come forward and can give suggestion from where to take
Can i insert image into struts text field
Can i insert image into struts text field  please tell me can i insert image into text field
I am having problem with configuring Hibernate sessionfactory. Please Help
and finding it difficult to configure the file.. Can you please help me.. Thanks...I am having problem with configuring Hibernate sessionfactory. Please Help  Sir, I am having problem with configuring Hibernate sessionfactory.. I
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s the problem?  I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s the problem?  I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s
Can anybody help me with this simple MySql code
cad 2013-03-16 18:26:31 can any one help me with the query because i want...Can anybody help me with this simple MySql code  select c.countryid... where r.countryid=t.countryid and t.countryid=c.country this is waht i gt whn
How can I generate diff image using Jmagick?
Jmagick. Can anybody help me get a diff image with similar metric using Jmagick...How can I generate diff image using Jmagick?  Hi, I used 'compare... a java code using the above mentioned 'compare' command, can anybody help me
Please , can any one answer this Question?
Please , can any one answer this Question?  How to cummunicate one web application to another web application in different places
How can I master Java in one month?
How can I master Java in one month?  Hi, I wish to learn Java programming in one month. I have little experience in c programming and PHP programming. Is there any way to learn Java quickly. How can I master Java in one month
sir i,have a assignment for these question plz help me sir - JavaMail
sir i,have a assignment for these question plz help me sir  ... test() { System.out.println("I am a bus"); } } class Car extends Vehicle{ void test() { System.out.println("I am a car"); } } class Bike extends
hello. can anyone help me with my java project, using jcreator?
hello. can anyone help me with my java project, using jcreator?  this is how it goes.. we are to develop a GUI of a certain form, in my case this one and then i should be able to create, view, search, and save using swamp.. i

Ads