优化主程序背景图像显示
This commit is contained in:
@@ -5,6 +5,7 @@ import javax.swing.*;
|
|||||||
import com.msksbr.LoginFrm.ScreenSize;
|
import com.msksbr.LoginFrm.ScreenSize;
|
||||||
import com.msksbr.SQL.Connector;
|
import com.msksbr.SQL.Connector;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -36,17 +37,12 @@ public class MainFrm extends JFrame {
|
|||||||
countMessage.setText(countData);
|
countMessage.setText(countData);
|
||||||
bottomPanel.add(countMessage);
|
bottomPanel.add(countMessage);
|
||||||
ImageIcon imageIcon = new ImageIcon("src/com/msksbr/images/backGround.png");
|
ImageIcon imageIcon = new ImageIcon("src/com/msksbr/images/backGround.png");
|
||||||
addComponentListener(new ComponentAdapter() {
|
imageIcon.setImage(imageIcon.getImage().getScaledInstance(250, 250, 0));
|
||||||
public void componentResized(ComponentEvent e) {
|
|
||||||
int imageSize = getWidth() < getHeight() ? getWidth() : getHeight();
|
|
||||||
imageIcon.setImage(imageIcon.getImage().getScaledInstance(imageSize / 2, imageSize / 2, 0));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
int imageSize = getWidth() < getHeight() ? getWidth() : getHeight();
|
|
||||||
imageIcon.setImage(imageIcon.getImage().getScaledInstance(imageSize / 2, imageSize / 2, 0));
|
|
||||||
|
|
||||||
backLabel.setIcon(imageIcon);
|
backLabel.setIcon(imageIcon);
|
||||||
|
|
||||||
|
setMinimumSize(new Dimension(960, 720));
|
||||||
|
|
||||||
setLocation();
|
setLocation();
|
||||||
initDialogs();
|
initDialogs();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user