Java Swing图形故障? [英] Java Swing graphics glitch?

查看:136
本文介绍了Java Swing图形故障?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上的Java图标。 (这里也缺少一段文字,当前标签标题应该是Uppdatera)



我没有在任何其他应用程序中遇到此问题,并且正在运行最新版本的Java平台的最新可用驱动程序对于我的Nvidia GeForce GT 630M。



您对我可以尝试解决的问题有任何建议吗?

解决方案

我遇到了这个问题,但我解决了它!
我所做的只是在看完本页后,我决定检查我的显卡的设置,并且我意识到这一点 -

https://www.youtube.com/watch?v=UWu3dyXlbAMrel =nofollow> https://www.youtube.com/watch?v=UWu3dyXlbAM



检查我做了什么。我所做的只是转到管理3D设置,然后单击查找并添加Java 1.8.0_25 ....,并将其设置为使用nVidia高性能处理器。我想新的Java只需要一个提示来使用好的图形:D。

Image of the glitch

I am learning Java by reproducing examples from a textbook and as soon as I got to using the GUI classes I experienced some weird glitches, if that is the correct term. As you can see on the image, parts of the text are missing.

The code generating this dialog isn't complicated either:

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;

public class InnerClassTest {
    public static void main(String[] args) {
        TalkingClock clock = new TalkingClock(1000, true);
        clock.start();

        // keep program running until user selects "OK"
        JOptionPane.showMessageDialog(null, "Quit program?");
        System.exit(0);
    }
}

class TalkingClock {
    /*
     * COnstructs a talking clock
     * @param interval the interval between messages (in milliseconds)
     * @param beep true if the clock should beep
    */
    public TalkingClock(int interval, boolean beep) {
        this.interval = interval;
        this.beep = beep;
    }

    /*
     * Start the clock.
    */
    public void start() {
        ActionListener listener = new TimePrinter();
        Timer t = new Timer(interval, listener);
        t.start();
    }

    private int interval;
    private boolean beep;

    class TimePrinter implements ActionListener {
        @Override public void actionPerformed(ActionEvent event) {
            Date now = new Date();
            System.out.println("At the tone, the time is " + now);
            if (beep) Toolkit.getDefaultToolkit().beep();
        }
    }
}

I get similair glitches when I open the Java "control panel". Look at the Java icon on this image. (A piece of text is missing here as well. The current tab title should be "Uppdatera")

I am not experiencing this issue in any other application and I am running an up-to-date version of the Java platform the latest available drivers for my Nvidia GeForce GT 630M.

Do you have any suggestion on things I can try to solve this?

解决方案

I had ran into this problem but I fixed it! All I did was after looking at this page, I went and decided to check my graphic card's settings, and I realized this -

https://www.youtube.com/watch?v=UWu3dyXlbAM

Check that for what I did. All I did was go to "Manage 3d Settings" and I clicked "Find" and added "Java 1.8.0_25...." and set it to use nVidia High Performance Processor. I guess new Java just needs a prompt to use the good graphics :D.

这篇关于Java Swing图形故障?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆