|
Sharof rashidov nomidagi samarqand davlat universiteti intellektual tizimlar va kompyuter texnologiyalari fakulteti
|
bet | 5/5 | Sana | 04.06.2024 | Hajmi | 93,48 Kb. | | #260199 | Turi | Referat |
Bog'liq 2mustaqilishJComboBox<String> combo = new JComboBox<>(items);
combo.setBounds(x, y, 140, 25);
combo.setToolTipText(toolTip);
combo.setCursor(new Cursor(Cursor.HAND_CURSOR));
window.add(combo);
return combo;
}
private JButton createButton(String label, int x, int y) {
JButton btn = new JButton(label);
btn.setBounds(x, y, BUTTON_WIDTH, BUTTON_HEIGHT);
btn.setFont(new Font("Comic Sans MS", Font.PLAIN, 28));
btn.setCursor(new Cursor(Cursor.HAND_CURSOR));
btn.setFocusable(false);
window.add(btn);
return btn;
}
private void applyTheme(Theme theme) {
window.getContentPane().setBackground(hex2Color(theme.getApplicationBackground()));
comboCalculatorType.setForeground(hex2Color(theme.getTextColor()));
comboTheme.setForeground(hex2Color(theme.getTextColor()));
inputScreen.setForeground(hex2Color(theme.getTextColor()));
btn0.setForeground(hex2Color(theme.getTextColor()));
btn1.setForeground(hex2Color(theme.getTextColor()));
btn2.setForeground(hex2Color(theme.getTextColor()));
btn3.setForeground(hex2Color(theme.getTextColor()));
btn4.setForeground(hex2Color(theme.getTextColor()));
btn5.setForeground(hex2Color(theme.getTextColor()));
btn6.setForeground(hex2Color(theme.getTextColor()));
btn7.setForeground(hex2Color(theme.getTextColor()));
btn8.setForeground(hex2Color(theme.getTextColor()));
btn9.setForeground(hex2Color(theme.getTextColor()));
btnPoint.setForeground(hex2Color(theme.getTextColor()));
btnC.setForeground(hex2Color(theme.getTextColor()));
btnBack.setForeground(hex2Color(theme.getTextColor()));
btnMod.setForeground(hex2Color(theme.getTextColor()));
btnDiv.setForeground(hex2Color(theme.getTextColor()));
btnMul.setForeground(hex2Color(theme.getTextColor()));
btnSub.setForeground(hex2Color(theme.getTextColor()));
btnAdd.setForeground(hex2Color(theme.getTextColor()));
btnRoot.setForeground(hex2Color(theme.getTextColor()));
btnLog.setForeground(hex2Color(theme.getTextColor()));
btnPower.setForeground(hex2Color(theme.getTextColor()));
btnEqual.setForeground(hex2Color(theme.getBtnEqualTextColor()));
comboCalculatorType.setBackground(hex2Color(theme.getApplicationBackground()));
comboTheme.setBackground(hex2Color(theme.getApplicationBackground()));
inputScreen.setBackground(hex2Color(theme.getApplicationBackground()));
btn0.setBackground(hex2Color(theme.getNumbersBackground()));
btn1.setBackground(hex2Color(theme.getNumbersBackground()));
btn2.setBackground(hex2Color(theme.getNumbersBackground()));
btn3.setBackground(hex2Color(theme.getNumbersBackground()));
btn4.setBackground(hex2Color(theme.getNumbersBackground()));
btn5.setBackground(hex2Color(theme.getNumbersBackground()));
btn6.setBackground(hex2Color(theme.getNumbersBackground()));
btn7.setBackground(hex2Color(theme.getNumbersBackground()));
btn8.setBackground(hex2Color(theme.getNumbersBackground()));
btn9.setBackground(hex2Color(theme.getNumbersBackground()));
btnPoint.setBackground(hex2Color(theme.getNumbersBackground()));
btnC.setBackground(hex2Color(theme.getOperatorBackground()));
btnBack.setBackground(hex2Color(theme.getOperatorBackground()));
btnMod.setBackground(hex2Color(theme.getOperatorBackground()));
btnDiv.setBackground(hex2Color(theme.getOperatorBackground()));
btnMul.setBackground(hex2Color(theme.getOperatorBackground()));
btnSub.setBackground(hex2Color(theme.getOperatorBackground()));
btnAdd.setBackground(hex2Color(theme.getOperatorBackground()));
btnRoot.setBackground(hex2Color(theme.getOperatorBackground()));
btnLog.setBackground(hex2Color(theme.getOperatorBackground()));
btnPower.setBackground(hex2Color(theme.getOperatorBackground()));
btnEqual.setBackground(hex2Color(theme.getBtnEqualBackground()));
}
}
|
| |