Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
不是您问题的答案,但您必须构建三个视图
1/您可以将 CalendarView 的网格放入
JTable
(季度/半/年 CalendarView 的最佳方法),但其中一部分是基于使用
GridLaout/GridBagLayout(7x7)
放置到JPanel
中的JButton/JTextField/JLabels
,最简单的方法是放置在这里
JButtons
,为了获得良好的输出,禁用上个月/下个月2/WeekView 时间表的日期,使用
JTable
和一个TableColumn
,在那里放置包含
,因为某些时间表可能被渗透(或对于其他JLabel
的 JPanelJComponents#setOpaque(false)
),或者通过使用
GridLayout(1, 7, 5, 5);
with7 x JPanel
for DayViewShedule(s)3/ for DayView with
GridLayout(1, 24, 5, 5);
带有 24 个JPanel
用于 HourShedule(s)not an answer to your question, but you have to building three view
1/ you can put a grid for CalendarView to the
JTable
(best way for quarter/half/year CalendarView),but part of them are based on
JButton/JTextField/JLabels
placed intoJPanel
withGridLaout/GridBagLayout(7x7)
,easiest way is if you placed here
JButtons
, for nice output disable days for prevoius/next Month2/ for WeekView shedules are used
JTable
with oneTableColumn
, there putJPanel
that containsJLabel
, because is possible that some shedules are penetrated (or for otherJComponents#setOpaque(false)
),or by using
GridLayout(1, 7, 5, 5);
with7 x JPanel
for DayViewShedule(s)3/ for DayView with
GridLayout(1, 24, 5, 5);
with 24 xJPanel
for HourShedule(s)查看 Kai Toedter 的 JCalendar http://www.toedter.com/en/jcalendar/
Check out JCalendar by Kai Toedter http://www.toedter.com/en/jcalendar/
我想出了一个在问题描述部分提到的映射器方法。您可以在下面找到该方法的内容。可能有更好的方法来做到这一点,但这完全满足我的需要。我利用两件事来计算 JTable 中相应的行和列索引,如下所示:
为了填充 JTable 中单元格的内容,我必须编写一个实现 TableCellRenderer 并扩展 JTextArea 的自定义渲染器。示例如下: http://archive.devx .com/java/free/articles/kabutz07/Kabutz07-2.asp
希望这可以帮助那些需要开发类似应用程序的人。
感谢您之前的回复。
此致
I came up with a mapper method that I mentioned in the problem description section. Below you can find the content of this method. There might be better ways to do this but this perfectly meets my need. I utilized two things to calculate the corresponding row and column indexes in the JTable as follows:
In order to fill the contents of the cells in the JTable, I had to write a custom renderer that implements TableCellRenderer and extends JTextArea. An example for this is available at: http://archive.devx.com/java/free/articles/kabutz07/Kabutz07-2.asp
Hope this helps those who needs to develop a similar application.
Thanks for the previous responses.
Best Regards