mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 06:18:00 +01:00
Fix java 6.
This commit is contained in:
parent
963a5e5a73
commit
07246e2d16
1 changed files with 9 additions and 4 deletions
|
@ -24,6 +24,8 @@ import javax.swing.UIManager;
|
||||||
import javax.swing.WindowConstants;
|
import javax.swing.WindowConstants;
|
||||||
|
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
import org.apache.commons.lang3.JavaVersion;
|
||||||
|
import org.apache.commons.lang3.SystemUtils;
|
||||||
import org.lwjgl.BufferUtils;
|
import org.lwjgl.BufferUtils;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.util.glu.GLU;
|
import org.lwjgl.util.glu.GLU;
|
||||||
|
@ -212,7 +214,10 @@ public class GuiSkinsMineLP extends GuiScreen implements IUploadCompleteCallback
|
||||||
* @wbp.parser.entryPoint
|
* @wbp.parser.entryPoint
|
||||||
*/
|
*/
|
||||||
private void enableDnd() {
|
private void enableDnd() {
|
||||||
if (fileDrop != null && fileDrop.isVisible()) {
|
if (!SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7))
|
||||||
|
return;
|
||||||
|
if (fileDrop != null) {
|
||||||
|
fileDrop.setVisible(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fileDrop = new JFrame("Skin Drop");
|
fileDrop = new JFrame("Skin Drop");
|
||||||
|
@ -231,7 +236,7 @@ public class GuiSkinsMineLP extends GuiScreen implements IUploadCompleteCallback
|
||||||
txtInst.setHorizontalAlignment(SwingConstants.CENTER);
|
txtInst.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
txtInst.setVerticalAlignment(SwingConstants.CENTER);
|
txtInst.setVerticalAlignment(SwingConstants.CENTER);
|
||||||
panel.add(txtInst);
|
panel.add(txtInst);
|
||||||
// Display.setParent(canvas);
|
|
||||||
DropTarget dt = new DropTarget();
|
DropTarget dt = new DropTarget();
|
||||||
fileDrop.setDropTarget(dt);
|
fileDrop.setDropTarget(dt);
|
||||||
try {
|
try {
|
||||||
|
@ -259,6 +264,7 @@ public class GuiSkinsMineLP extends GuiScreen implements IUploadCompleteCallback
|
||||||
@Override
|
@Override
|
||||||
public void onGuiClosed() {
|
public void onGuiClosed() {
|
||||||
super.onGuiClosed();
|
super.onGuiClosed();
|
||||||
|
if (this.fileDrop != null)
|
||||||
this.fileDrop.dispose();
|
this.fileDrop.dispose();
|
||||||
this.localPlayer.releaseTextures();
|
this.localPlayer.releaseTextures();
|
||||||
this.remotePlayer.releaseTextures();
|
this.remotePlayer.releaseTextures();
|
||||||
|
@ -273,7 +279,6 @@ public class GuiSkinsMineLP extends GuiScreen implements IUploadCompleteCallback
|
||||||
if (dialogResult == 0) {
|
if (dialogResult == 0) {
|
||||||
this.loadLocalFile(fileDialog.getSelectedFile());
|
this.loadLocalFile(fileDialog.getSelectedFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadLocalFile(File skinFile) {
|
private void loadLocalFile(File skinFile) {
|
||||||
|
|
Loading…
Reference in a new issue