【190516】vc++ 一个动感拉帘式TAB选项卡源代码

源码下载简介

一个VC++窗体TAB选项卡,切换的时候像拉帘一样从边框移动预定位置,整个TAB都是移动,给静态的窗体界面增添一些动感元素,景两年的网络蚂蚁软件曾有过这种效果。

源码下载地址:点击下载

备用下载地址:点击下载

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是使用Java代码实现底部导航栏和Tab选项卡的示例: ``` import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class BottomNavigationBar extends JFrame implements ActionListener { private JPanel bottomPanel, tabPanel; private JButton homeButton, searchButton, profileButton; private JLabel homeLabel, searchLabel, profileLabel; private CardLayout cardLayout; public BottomNavigationBar() { initComponents(); } private void initComponents() { setTitle("Bottom Navigation Bar"); bottomPanel = new JPanel(new BorderLayout()); tabPanel = new JPanel(new GridLayout(1, 3)); homeButton = new JButton(new ImageIcon("home.png")); searchButton = new JButton(new ImageIcon("search.png")); profileButton = new JButton(new ImageIcon("profile.png")); homeLabel = new JLabel("Home"); searchLabel = new JLabel("Search"); profileLabel = new JLabel("Profile"); homeButton.addActionListener(this); searchButton.addActionListener(this); profileButton.addActionListener(this); tabPanel.add(homeButton); tabPanel.add(searchButton); tabPanel.add(profileButton); bottomPanel.add(tabPanel, BorderLayout.CENTER); bottomPanel.add(homeLabel, BorderLayout.WEST); bottomPanel.add(searchLabel, BorderLayout.CENTER); bottomPanel.add(profileLabel, BorderLayout.EAST); cardLayout = new CardLayout(); JPanel contentPanel = new JPanel(cardLayout); contentPanel.add(new JLabel("Home Screen"), "Home"); contentPanel.add(new JLabel("Search Screen"), "Search"); contentPanel.add(new JLabel("Profile Screen"), "Profile"); add(bottomPanel, BorderLayout.SOUTH); add(contentPanel, BorderLayout.CENTER); setSize(500, 500); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == homeButton) { cardLayout.show(tabPanel, "Home"); } else if (e.getSource() == searchButton) { cardLayout.show(tabPanel, "Search"); } else if (e.getSource() == profileButton) { cardLayout.show(tabPanel, "Profile"); } } public static void main(String[] args) { new BottomNavigationBar(); } } ``` 在这个示例中,底部导航栏由三个按钮和标签组成,分别用于在主屏幕,搜索屏幕和个人资料屏幕之间进行切换。CardLayout用于管理不同屏幕之间的切换。当用户点击底部导航栏上的一个按钮时,相应的屏幕将显示在中心面板上。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值