Skip to main content

34 docs tagged with "java"

View all tags

Fxxk PHP! A Javaer's Experience Migrating Large PHP Projects

When migrating old code, the most painful thing is staring at this huge pile of code - you look at it, it looks at you, over and over again, but you still don't know what the code does. No comments, no documentation, meaningless variable names, context that seems to talk past itself, a method that's over 2000 lines, strange patterns everywhere, if statements nested 7-8 levels deep in loops like the abyss, and to get a certain property you have to traverse 7 classes and a dozen methods before you finally see that crooked SQL statement with a comment that just says "RUN"

Java获取电脑显示器的分辨率

可以使用 Java 的 java.awt.Toolkit 类获取电脑显示器的分辨率。具体地,可以使用 Toolkit.getDefaultToolkit().getScreenSize() 方法获取屏幕的尺寸,或者使用 Toolkit.getDefaultToolkit().getScreenResolution() 方法获取屏幕的分辨率(单位为每英寸像素数)。