2011-07-13 220 views
-1

我创建了一个媒体播放器,其工作正常。我希望在媒体播放器底部创建一个弹出窗口....我在谷歌搜索一些示例代码,但我真的很困惑...任何一个给我的想法和一些示例链接.......如何创建弹出窗口?

Element description: 

1. The copyright, disclaimer and buy block, this block contains links to popup 
    windows that contain a copyright and or disclaimer. And an option to buy the 
    application for the advertisement less version. The content of this block is fed trough 
    the application XML feed. The color of the text is fed by the application xml plus the 
    popup links and texts itself; 

回答

2

试试这个; http://android-er.blogspot.com/2011/06/custom-alertdialog.html

编辑: 对不起,由于我的限制网络中,我能不能添加评论,所以我编辑我的答案。

你所说的弹出寡妇,在Android中它被称为对话框,直到用户与其进行交互

如果您不希望该用户输入,那么你可以选择在屏幕上显示吐司,它停留在屏幕上指定的时间和此链接敏锐地自动消失

研究,你的困惑会告一段落: http://developer.android.com/guide/topics/ui/dialogs.html

+0

只是一个链接不是一个好的答案。请至少提供一个摘要。 – Nanne

+0

你能解释一下弹出窗口吗?为什么我们正在使用我们的项目。我很困惑...请 – balaji

+0

这个链接完全困惑了我......请提供另一个链接给我一个简单的编码......... – balaji

0

您可以使用JDialogJOptionPane。以下是您如何使用的示例:JOptionPane

JPanel panel = new JPanel(); 
// Add whatever you want to the panel 
JOptionPane pane = new JOptionPane(); 
JButton btnAdd = new JButton("OK"); 
JButton btnCancel = new JButton("Cancel"); 
Object[] options = {btnAdd, btnCancel}; 
pane.showOptionDialog(null, panel, "The Title", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, null);