Traditional Culture Encyclopedia - Hotel reservation - JAVA SWING hotel management system interface room button discoloration and other issues.
JAVA SWING hotel management system interface room button discoloration and other issues.
Public? Class? Room {
int? Num// number
int? Price; //Price
String? Type; //type
//... constructor. Setter? getter? ,? toString,HashCode,equals? equilong
} Then, customize a JButton class. When constructing this class, you need to pass in a room class.
Public? Room button? Extension? Button {
Room? Room;
Public? RoomButton (room? Room) {
This.room = room; ? //? This puts the room information in the button.
}
Public? Room? getRoom(){
Return? Room;
}
} Third, add a mouse event responder to the button, take out the room when the mouse moves to the button, and then set the information in the room as JLabel.
jlabel . settext(room button . getroom()。 getNum()); ? //Display the rendering after the numbering is completed.
- Related articles
- Who is Zhang Xiulan's husband in Wenshan, Yunnan?
- Italy, 7 days, how much money is appropriate?
- Which bus should I take from Han Shu Road East Station to Changsheng Imperial Capital Hotel on Yongfeng Road in Wuhou District?
- What's the tourist quotation of Taiwan Province Province in Shanghai?
- What does the supervisor do at the wedding?
- Yu Hao Rome Hotel Chengdu
- What is the specific information of Shanghai Happy Wan Licheng?
- Female students, do you know how to protect yourself when traveling?
- The moral of the title
- Suqian Yintan Tourist Attractions introduces Suqian's recent seaside tourism.