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



Home Answers Viewqa Swing-AWT I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this

Have Programming Question? Ask it here!
 
 
 


mani
I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this
0 Answer(s)      a year ago
Posted in : Swing AWT


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

}


Advertisement
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
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
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
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
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>
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
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 ...   ...) JOptionPane.showMessageDialog(null," Album is Full you can not push the image ."); else
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
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
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
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
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
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
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
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 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
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
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
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
I am new to programming and I am not sure what to do next? Any ideas?
I am new to programming and I am not sure what to do next? Any ideas? ...()==0) return false; for(int i=0;i<=str.length();i++) if (c==str.charAt(i)); return true; } // If userInputs
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
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
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
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
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 getting error.How can i get details
I am getting error.How can i get details  Exception in thread "main" java.sql.SQLException: Listener refused the connecti n with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect
Begineer Help Help Please Thanks A million ) I am using Jcreator
Begineer Help Help Please Thanks A million ) I am using Jcreator  ...: $ 1.00 Retained Earnings: $ 2.00 I don't know how to sort the array in such a way that it still can function like this but without the null values.My
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
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.
i am inserting an image into database but it is showing relative path not absolute path
i am inserting an image into database but it is showing relative path not absolute path   hi my first page......... Image Enter your name... got error java.io.filenotfoundexception....... please go through it and help me
i am inserting an image into database but it is showing relative path not absolute path
i am inserting an image into database but it is showing relative path not absolute path   hi my first page......... Image Enter your name... got error java.io.filenotfoundexception....... please go through it and help me
i am inserting an image into database but it is showing relative path not absolute path
i am inserting an image into database but it is showing relative path...) { System.out.println(e); } %> </body> </html> when i compiled it i got error "java.io.filenotfoundexception" please go through it and help me
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
A DVR Mobile Application Can Get Any Problem Recorded with Ease
A DVR Mobile Application Can Get Any Problem Recorded with Ease The Digital... for a good mobile application. The DVR is something that can be used to help... the use of any tapes or discs. A user can even program one of these DVR drives
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
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.
netbeans-6.1-ml-windows.How can I set up connection to database? Please help me...How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.  I am using postgresql-8.4.4-1
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
can i know the error in this code... am unable to run this code
can i know the error in this code... am unable to run this code  ...}; int n=arr.lenght; System.out.println("length of array:"+n); for(int i=0;i System.out.println(arr[i]); } }   You have used incorrect symbol in your
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
Can you give me Hibernate one to one example?
Can you give me Hibernate one to one example?  Hello there, Can you give me a hibernate one to one example that explain the concept and mapping in Hibernate. Thanks in advance
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
 

 

 

DMCA.com