0

Hi there. I have a problem to one my PC. Source code is correct. My problem is in graphic render. This bug only on one laptop. Example screens in 1 PC:

(screen in http://)

JLabel - i.gyazo.com/deafe8b111007562e47d93ab4f9728a3.png

JMenu - i.gyazo.com/1d5c5babd243d958073d2635f64b0e8a.png

JMenuItem - http://i.gyazo.com/aca39fd386d7d186c1f22bb2d629148e.png

JMenuItem - i.gyazo.com/d78f33834913e4548edf93f8bd996002.png


On other PC's there is no problems.: http://i.gyazo.com/51e9c928627d7091bbb302b5eb78b6a2.png


I thought that problem was in java JRE (I use v1.7) and I reinstalled it. But the problem remains. Also, I switched off Desktop Composition - but there is no luck either. What should I do now? Maybe the problem is in video driver or hardware acceleration? Tell me how to solve the problem?

[message edited]

Example "bug code":

public class Example extends JFrame {

        private static final long serialVersionUID = 1L;

        public Example(){

                JMenuBar menuBar = new JMenuBar();
                setJMenuBar(menuBar);

                JMenu mnNewMenu = new JMenu("\u041C\u0435\u043D\u044E");
                menuBar.add(mnNewMenu);

                JMenuItem mntmNewMenuItem = new JMenuItem("\u0424\u0430\u0439\u043B");
                mnNewMenu.add(mntmNewMenuItem);

                JMenuItem mntmNewMenuItem_1 = new JMenuItem("\u0412\u044B\u0445\u043E\u0434");
                mnNewMenu.add(mntmNewMenuItem_1);

        }



        public static void main(String[] args){

                Example form = new Example();
                form.setSize(640,480);
                form.setLocationRelativeTo(null);
                form.setVisible(true);

        }


}

screen bug: i.gyazo.com/9fcf258e62c498f8468d47b7f73759e1.png

screen normal: i.gyazo.com/ec27e655a0209e4613c3a19863fa0e18.png


Ok, this problem solved!

From my PC, i added lines:

System.setProperty("sun.java2d.d3d",        "false");
System.setProperty("sun.java2d.ddoffscreen","false");
System.setProperty("sun.java2d.noddraw",    "true");

This video driver error.

test123
  • 173
  • 11
  • 3
    _Source code applications - true correct, it is not discussed_ I would most likely assume the opposite and assume first that the problem is your code. Post an [MCVE](http://stackoverflow.com/help/mcve). – Guillaume Polet Dec 29 '14 at 12:42
  • My code is long enough. I'll give you link: [archive source code](https://yadi.sk/d/_lSStzHidguH4) All draw is standart. I'm haven't used override draw for components. – test123 Dec 29 '14 at 13:09
  • 6
    _My code is long enough_ Hence the idea of [MCVE](http://stackoverflow.com/help/mcve) – Guillaume Polet Dec 29 '14 at 13:19
  • this minimal example: http://pastebin.com/kkXFmUwY screen bag: http://i.gyazo.com/9fcf258e62c498f8468d47b7f73759e1.png screen normal: http://i.gyazo.com/ec27e655a0209e4613c3a19863fa0e18.png – test123 Dec 29 '14 at 13:20
  • 1
    Your small example works for me. You might want to google for "swing rendering bug". Or look at [this](http://stackoverflow.com/questions/8081559/is-this-a-swing-java-7-rendering-bug) or [this](http://stackoverflow.com/questions/27201864/java-swing-wrong-rendering-gui-elements-windows-8-1) (check the comments under the accepted answer). – Tom Dec 29 '14 at 13:57
  • 2
    1) Swing GUIs should be constructed on the EDT. See [Concurrency in Swing](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/) (especially 'Initial Threads') for more details. 2) Always call `pack()` on a frame after all components have been added, but before being set visible. – Andrew Thompson Dec 30 '14 at 04:40

0 Answers0