我在我的应用程序中使用倒数计时器,我需要显示即将到来的日期,以小时,分钟和秒为单位.我得到了日,小时,分钟和秒,但是当我将其设置为文本视图时倒计时没有开始.是我的代码.
Date date = new Date(2013,Integer.parseInt(datess.get(k).split("-")[1])-1,Integer.parseInt(datess.get(k).split("-")[0]),hours,mins,secs);
long dtMili = System.currentTimeMillis();
Date dateNow = new Date(dtMili);
remain = date.getTime() - dateNow.getTime();
MyCount counter = new MyCount(remain,1000);
counter.start();
public class MyCount extends CountDownTimer{
public MyCount(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}
@Override
public void onFinish() {
// TODO Auto-generated method stub
tv3.setText("done");
}
@Override
public void onTick(long millisUntilFinished) {
// TODO Auto-generated method stub
tv3.setText(timeCalculate(millisUntilFinished/1000) + " Countdown");
}
}
public String timeCalculate(long ttime)
{
long daysuuu,hoursuuu, minutesuuu, secondsuuu;
String daysT …Run Code Online (Sandbox Code Playgroud) 我正在制作一个有许多按钮的摇摆gui.我有许多操作,其中按钮有时禁用和启用.我想为仅启用的按钮设置工具提示.当按钮禁用时,我不想要该按钮的任何工具提示.
任何人都可以给我一些关于为Java swing应用程序准备自定义Mac安装程序的建议.我尝试过Xcode但没用.任何建议都会非常有用.
提前致谢...
我正在使用Eclipse IDE开发android项目.由于两天我的文件以所有点和符号打开.你能告诉我们这是什么原因吗?如何删除这些符号?

谢谢,
我在一个名为footer.xml的布局中有一个imageview,它实际上被添加为listview的页脚.我需要在listview的末尾动态显示图像.所以我在我的java文件中引用了imageview,如下所示
ImageView footerimage;
View footerView = getLayoutInflater().inflate(R.layout.footer, null);//This is the footer layout which i have added to the listview
footerimage = (ImageView)findViewById(R.id.im);
footerimage.setBackgroundResource(images[i]);//images is an integer array which has drawable resources and i value is not null.
lv.addFooterView(footerView, null, false);
Run Code Online (Sandbox Code Playgroud)
我在上面的代码的第四行得到一个空指针异常.我还将图像[i]更改为R.drawable.someimage,但NPE仍然存在.下面是我的页脚布局
<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)
<ImageView
android:id="@+id/im"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:contentDescription="@string/app_name" />
Run Code Online (Sandbox Code Playgroud)
任何建议都表示赞赏.谢谢
单击按钮时,我将文本字段(输入)中的项目保存到JComboBox.用户可以给出以小写字母开头的输入,但我想将输入的第一个字母更改为大写.我怎样才能做到这一点?