Results 1 to 4 of 4
- 01-30-2012, 08:33 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 48
- Rep Power
- 0
how to display a video from a JList?
I am currently doing an application using Swing and i am stuck at a certain point. In my function, i have to link videos from a JList. The problem is i am not sure how to link the videos from the JList. I am using an OpenBrowser class to link the video to the internet. I did consider using JButton but i would have to hard-code the button and that would be ugly. At this point, i am able to display the list of videos that i hard-coded however, in the actual
function, i would have to retrieve the videos from the database and display it in the Internet. I have already tried launching it with a double click on a
JList entry but from there i am not sure how to go to the internet. Is there any other alternatives to do this? I am in desperate need and would be eternally grateful to whoever that can help me.
Java Code:private JList getJListVideos() { if (jListVideos == null) { String[] videos = {"v1", "v2", "v3", "v4", "v5"}; jListVideos = new JList(videos); jListVideos.setFixedCellHeight(27); jListVideos.setFixedCellWidth(130); jListVideos.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jListVideos.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { JList list = (JList)evt.getSource(); if (evt.getClickCount() == 2) { //check if it is a Double-click int index = list.locationToIndex(evt.getPoint()); //do whatever you want with the entry at that index String kbs = (String) jListVideos.getSelectedValue(); KBSVideos k1 = new KBSVideos(); k1.retrieveKBS(); ViewKBSVideosFrame kbsFrame = new ViewKBSVideosFrame(k1); kbsFrame.setVisible(true); k1.getKbs_videoURL(); System.out.println(k1.retrieveKBS()); } } }); return jListVideos; } return jListArticles; }
- 01-30-2012, 08:38 AM #2
Re: how to display a video from a JList?
What's this 'Internet' you refer to? It's obviously not the Intenet as generally understood.
Moving to the Swing section.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-30-2012, 08:52 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 48
- Rep Power
- 0
Re: how to display a video from a JList?
The internet that i am referring to is the internet we generally understand. In my case, as i wish to retrieve videos, i want to go to Youtube for example.
Sorry if i was not clear in the question.
- 01-30-2012, 11:40 AM #4
Re: how to display a video from a JList?
i would have to retrieve the videos from the database and display it in the Internet.i am not sure how to go to the internet.Certainly not the meaning of the word as I understand it.The internet that i am referring to is the internet we generally understand.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Retrieving data from database using arrayList and display on JList
By mathidioticz in forum New To JavaReplies: 1Last Post: 01-25-2012, 05:10 PM -
Collection to JList to Display
By D.Calladine in forum New To JavaReplies: 1Last Post: 12-03-2010, 12:53 PM -
[SOLVED] JList( Vector ) Display problem
By logicbug in forum AWT / SwingReplies: 4Last Post: 03-21-2009, 02:28 PM -
How do I display a JList with icons and text?
By aneesahamedaa in forum AWT / SwingReplies: 2Last Post: 09-04-2008, 08:49 AM -
how to display strings on a video
By dim_ath in forum New To JavaReplies: 0Last Post: 05-03-2008, 10:10 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks