本文整理汇总了Java中javax.swing.JPanel.getComponentCount方法的典型用法代码示例。如果您正苦于以下问题:Java JPanel.getComponentCount方法的具体用法?Java JPanel.getComponentCount怎么用?Java JPanel.getComponentCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JPanel
的用法示例。
在下文中一共展示了JPanel.getComponentCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clear
import javax.swing.JPanel; //导入方法依赖的package包/类
public static void clear(JPanel paneColEdit)
{
if (paneColEdit.getComponentCount() == 1)
{
paneColEdit.remove(0);
paneColEdit.updateUI();
}
}
示例2: setEnabled
import javax.swing.JPanel; //导入方法依赖的package包/类
private void setEnabled (JPanel panel, boolean enabled) {
for (int i = 0; i < panel.getComponentCount(); ++i) {
panel.getComponent(i).setEnabled(enabled);
}
}
示例3: printDayWeek
import javax.swing.JPanel; //导入方法依赖的package包/类
private void printDayWeek(JPanel panel, GridAndParams res, int weekDay) {
final GregorianCalendar gc = new GregorianCalendar();
panel.removeAll();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
for (Date dd : res.getTimes()) {
gc.setTime(dd);
int ii = gc.get(GregorianCalendar.DAY_OF_WEEK) - 1;
if (ii < 1) {
ii = 7;
}
gc.setTime(this.firstWeekDay);
gc.add(GregorianCalendar.DAY_OF_WEEK, ii - 1);
final GregorianCalendar gc_client = new GregorianCalendar();
final GregorianCalendar gc_now = new GregorianCalendar();
gc_client.setTime(dd);
gc_now.setTime(new Date());
// проверим не отлистал ли пользователь слишком далеко, куда уже нельзя
boolean f = true;
int per = 0;
if (gc_client.get(GregorianCalendar.DAY_OF_YEAR) - gc_now
.get(GregorianCalendar.DAY_OF_YEAR)
> 0) {
per = gc_client.get(GregorianCalendar.DAY_OF_YEAR) - gc_now
.get(GregorianCalendar.DAY_OF_YEAR);
} else {
per = gc_client.get(GregorianCalendar.DAY_OF_YEAR) + (
gc_now.isLeapYear(gc_now.get(GregorianCalendar.YEAR)) ? 365
: 366 - gc_now.get(GregorianCalendar.DAY_OF_YEAR));
}
if (per > res.getAdvanceLimitPeriod() && res.getAdvanceLimitPeriod() != 0) {
f = false;
}
if (ii == weekDay && f && gc.getTime().after(gc_now.getTime())) {
panel.add(new QAvancePanel(new IAdviceEvent() {
@Override
public void eventPerformed(Date date) {
if (clockBack.isActive()) {
clockBack.stop();
}
// ставим предварительного кастомера
result = NetCommander
.standInServiceAdvance(netProperty, service.getId(), date,
advancedCustomer,
inputData, comments);
// закрываем диалог выбора предварительного выбора времени
setVisible(false);
}
}, dd, true));
}
}
if (panel.getComponentCount() == 0) {
panel.setLayout(new GridLayout(1, 1));
panel.add(new JLabel(new ImageIcon(
Uses.loadImage(this, "/ru/apertum/qsystem/client/forms/resources/noActive.png",
null)),
JLabel.CENTER));
}
}