云南省昆明市对宠物饲养的管理规定细则
时间: 2024-06-10 20:05:04 浏览: 11
根据云南省昆明市的相关规定,养宠物需要遵守以下规定:
1. 宠物必须在个人住宅内养护,禁止在公共场所、公共绿地、公共交通工具内、商场、酒店等场所养护。
2. 必须遵守有关动物侵害预防和管理规定,宠物不能损害公共利益和他人的生命、财产,否则将承担相应的法律责任。
3. 動物應當按時施打疫苗,進行定期的健康檢查。
4. 在公共場所遛狗,必须使用狗绳,并由成年人持续看管。
以上是我所了解的关于云南省昆明市对宠物饲养的管理规定细则。如有不正确的地方,望海涵指正。
相关问题
民法典关于宠物饲养的规定细则
民法典对宠物饲养的规定主要包括以下几个方面:
1. 宠物的权益保护:民法典明确规定,宠物是合法的财产,饲养者应当尊重并保护宠物的权益,不得虐待、遗弃或者非法买卖宠物。
2. 宠物饲养的责任:饲养者应当履行维护、饲养、管理宠物的责任,确保宠物健康成长,不得危害社会公共利益和环境卫生。
3. 宠物在公共场所的管理:饲养者应当在公共场所控制宠物行为,不得影响公共卫生和其他人的正常活动。
4. 宠物的损害赔偿:如果宠物造成了他人损害,饲养者应当承担相应的赔偿责任。
以上是民法典对宠物饲养的规定细则。需要注意的是,不同地区对于宠物饲养的管理规定可能有所不同,饲养者应当遵守当地相关法规。
java gui宠物饲养系统
下面是一个简单的Java GUI宠物饲养系统的示例代码,仅供参考:
```java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class PetSystem extends JFrame implements ActionListener {
private JTextField nameField;
private JTextField typeField;
private JTextField ageField;
private JTextField weightField;
private JButton addButton;
private JTextArea petListArea;
public PetSystem() {
super("宠物饲养系统");
setSize(400, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// 创建添加宠物的组件
JLabel nameLabel = new JLabel("宠物名称:");
nameField = new JTextField(20);
JLabel typeLabel = new JLabel("宠物种类:");
typeField = new JTextField(20);
JLabel ageLabel = new JLabel("宠物年龄:");
ageField = new JTextField(20);
JLabel weightLabel = new JLabel("宠物体重:");
weightField = new JTextField(20);
addButton = new JButton("添加");
addButton.addActionListener(this);
// 将添加宠物的组件添加到面板中
JPanel addPanel = new JPanel(new GridLayout(5, 2));
addPanel.add(nameLabel);
addPanel.add(nameField);
addPanel.add(typeLabel);
addPanel.add(typeField);
addPanel.add(ageLabel);
addPanel.add(ageField);
addPanel.add(weightLabel);
addPanel.add(weightField);
addPanel.add(addButton);
// 创建宠物列表的组件
JLabel petListLabel = new JLabel("宠物列表:");
petListArea = new JTextArea(15, 30);
petListArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(petListArea);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
// 将宠物列表的组件添加到面板中
JPanel petListPanel = new JPanel(new BorderLayout());
petListPanel.add(petListLabel, BorderLayout.NORTH);
petListPanel.add(scrollPane, BorderLayout.CENTER);
// 将面板添加到窗口中
JPanel panel = new JPanel(new BorderLayout());
panel.add(addPanel, BorderLayout.NORTH);
panel.add(petListPanel, BorderLayout.CENTER);
add(panel);
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
// 获取用户输入的宠物信息
String name = nameField.getText();
String type = typeField.getText();
int age = Integer.parseInt(ageField.getText());
double weight = Double.parseDouble(weightField.getText());
// 创建宠物对象并添加到列表中
Pet pet = new Pet(name, type, age, weight);
petListArea.append(pet.toString() + "\n");
// 清空用户输入的宠物信息
nameField.setText("");
typeField.setText("");
ageField.setText("");
weightField.setText("");
}
public static void main(String[] args) {
new PetSystem();
}
}
class Pet {
private String name;
private String type;
private int age;
private double weight;
public Pet(String name, String type, int age, double weight) {
this.name = name;
this.type = type;
this.age = age;
this.weight = weight;
}
public String getName() {
return name;
}
public String getType() {
return type;
}
public int getAge() {
return age;
}
public double getWeight() {
return weight;
}
@Override
public String toString() {
return "名称:" + name + ",种类:" + type + ",年龄:" + age + "岁,体重:" + weight + "kg";
}
}
```
在这个例子中,用户可以在添加宠物的面板中输入宠物的名称、种类、年龄和体重,并点击“添加”按钮将宠物添加到宠物列表中。宠物列表使用JTextArea组件实现,并使用JScrollPane组件添加滚动条。当用户点击“添加”按钮后,程序会创建一个Pet对象并将它添加到宠物列表中,并清空用户输入的宠物信息。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)