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
Login         

View Questions and Answers by Category

Advertisements


 
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 and a month 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
Hii i want a JMS application can anybody help me
Hii i want a JMS application can anybody help me  jms application
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
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 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
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
 

 

 

DMCA.com