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);
}
}
}
}
}
}