Package service

Source Code of service.FieldCleaner

package service;

import hibernateSwingApi.component.CTextArea;
import hibernateSwingApi.component.CTextField;

import java.awt.Component;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class FieldCleaner {
 
public void temizleClicked(JPanel jPanel) {
   
    Component[] comp = jPanel.getComponents();
    for (Component component : comp) {
      if (component.getClass().equals(javax.swing.JPanel.class)) {
        temizleClicked((JPanel) component);
      }
      if(component.getClass().equals(hibernateSwingApi.component.CTextField.class)){
        CTextField ctf = (CTextField) component;
        ctf.setText("");
      }
      if (component.getClass().equals(hibernateSwingApi.component.CTextArea.class)) {
        CTextArea cta=(CTextArea) component;
        cta.setText("");
      }
      if (component.getClass().equals(javax.swing.JTabbedPane.class)) {
        JTabbedPane jtp= (JTabbedPane) component;
        Component[] components1 = jtp.getComponents();
        for (Component comps1 : components1) {
          if (comps1.getClass().equals(javax.swing.JPanel.class)) {
            JPanel jpnl = (JPanel) comps1;
            temizleClicked(jpnl);
          }
        }
      }
    }
  }
}
TOP

Related Classes of service.FieldCleaner

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.