Java Swing的元素转换 [英] Java Swing element transitions

查看:273
本文介绍了Java Swing的元素转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一个小的非商业应用程序,使其拥有一个精心设计的界面,与屏幕的过渡和等。我每天在一个JFrame中的分隔面板中的屏幕,并希望面板之间的转换时,能够将它们滑动顺畅。有什么办法有所容易做到这一点?

I am trying to make a small non-commercial app and make it have a well designed interface, with screen transitions and such. I have every "screen" on separate panels in one JFrame and wish to be able to slide them smoothly when transitioning between panels. Is there any way to accomplish this somewhat easily?

推荐答案

因为你没接受了答案,我可以建议你的 SlidingLayout库
这是一个非常小的库,目的就是为了某些成分的两种布局之间创建平滑的过渡。从而,使两个屏幕之间的过渡是很容易做到的。这里我只是做了一个例子:

Since you did not accepted an answer yet, may I suggest you the SlidingLayout library? It's a very small library which aim is to create smooth transitions between two layouts of some components. Thus, making a transition between two screens is very easy to do. Here's an example I just made:

这两个过渡过程之间的差异依赖于code的两行。您还可以通过每个组件应用不同的延迟创造更多的花哨的过渡,所以他们很显然并不是所有的一次,但与它们之间的一些时间的变化。

The difference between the two transitions relies on two lines of code. You can also create more fancy transitions by applying a different delay on each component, so they appear not all at once but with some timing variations between them.

我希望它可能对你有用:)

I hope it may be useful to you :)

这篇关于Java Swing的元素转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆