我的JTabel上的列出现了:/我无法找到原因,因为我的滚动条没有显示出来.作为新手,我无法找到原因.
这是我的代码:
String [] columnNames = {"From", "Depature","To","Arrvial",};
Object[][] data = {
{"Orlando, FL", "3/15/2014 @ 8:00 AM", "Atlanta, GA", "3/15/2014 @ 9:05 AM"},
{"Atlanta, GA", "3/16/2014 @ 11:49 AM", "Chicago, IL", "3/16/2014 @ 1:05 PM"},
{"Chicago, IL", "3/17/2014 @ 1:25 PM", "San Francisco, CA", "3/17/2014 @ 6:05 PM"},
{"San Francisco, CA", "3/18/2014 @ 2:10 PM", "Seattle, WA", "3/18/2014 @ 5:35 PM"},
{"Seattle, WA", "3/19/2014 @ 4:35 PM", "Atlanta, GA", "3/19/2014 @ 10:45 PM"},
{"Orlando, FL", "3/15/2014 @ 8:00 AM", …Run Code Online (Sandbox Code Playgroud) 我正在尝试向我的Checkout页面添加一个自定义标题,我已经想到从页面中删除标题基本上是在/layout/checkout.xml文件中添加一个节点,任何人都可以解释如何基本上只有一个新的修改标题适用于所有Checkout页面.
当前默认/ layout/checkout.xml
<default>
<remove name="footer"> <!-- removes the footer from checkout -->
... // all other xml data..
</default>
Run Code Online (Sandbox Code Playgroud)
我的主题的伪代码
if (a CHECKOUT PAGE) {
use 'custom checkout header'
else
use the standard default header.
Run Code Online (Sandbox Code Playgroud) 我已经编写了以下代码来添加一个JLabela JPanel但它显示在中心,而我预计它将被放置在顶部JPanel.
这是我所指的那段代码:
JPanel pnlProjects = new JPanel();
pnlProjects.setMinimumSize(new Dimension(10, 300));
GridBagLayout gridBagLayout = new GridBagLayout();
pnlProjects.setLayout(gridBagLayout);
GridBagConstraints gridBagConstraints = new GridBagConstraints();
// add multiple label dynamically;
for (int count = 0; count < project.length; count++) {
lblProjects[count] = new JLabel("Project"+count );
lblProjects[count].setHorizontalAlignment(SwingConstants.LEFT);
lblProjects[count].setHorizontalTextPosition(SwingConstants.LEFT);
lblProjects[count].setBorder(BorderFactory.createBevelBorder(0));
lblProjects[count].setPreferredSize(new Dimension(100, 20));
gridBagConstraints.fill = GridBagConstraints.VERTICAL;
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = count;
pnlProjects.add(lblProjects[count], gridBagConstraints);
}
// Add project panel in to the scorllPan
JScrollPane jspProjectlist = new JScrollPane(pnlProjects);
Run Code Online (Sandbox Code Playgroud)

有人会根据我的要求向我解释如何改变它吗?
美好的一天,我正在开发一个Android应用程序,生成漫画像专辑,我需要适应任何屏幕宽度,但我很难做到它的布局,它非常奇怪,似乎没有彼此对齐, 这里 : 
那些盒子由FrameLayout包含和ImageView(后)的框架组成,框架是框架图像的PNG(中间)和TextView顶部.所以基本上设计非常复杂和奇怪,我听说有一种方法可以在IOS的每个屏幕上自动调整,他们称之为自动布局.在android上有这个对应部分吗?谢谢.
我陷入了一种情况......我的父布局是可滚动的布局.在这个布局中,我有一个webview和一个tablelayout.某些数据在此可滚动布局中膨胀.
我的问题是,我的垂直可滚动功能似乎被禁用,因为我的可滚动布局已经具有该功能.我几乎无法在webview中上下滚动.Mapview也是如此.我只能使用水平手势放大和缩小.我想知道是否有任何方法只有当我放大/缩小,在mapview/webview中向上/向下滚动时才能禁用滚动功能.非常感谢.
我正在尝试为独立应用程序创建一个清晰的Java UI布局.我知道JSwing不是最好的UI,但它就是我现在所拥有的.
我的UI目前看起来像:

我希望文本排成一行,按钮排列,向上,以及所有这些按钮的提交和状态,彼此堆叠或平行.
我的布局目前是这样的:
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
layout.setHorizontalGroup(layout.createSequentialGroup()
.addComponent(lbl_inputFile)
.addComponent(txt_inputFile)
.addComponent(btn_inputFile)
.addGroup(layout.createSequentialGroup()
.addComponent(lbl_searchTermFile)
.addComponent(txt_searchTermFile)
.addComponent(btn_searchTermFile))
.addGroup(layout.createSequentialGroup()
.addComponent(lbl_outputFile)
.addComponent(txt_outputFile)
.addComponent(btn_outputFile))
.addGroup(layout.createSequentialGroup()
.addComponent(btn_sumbit)
.addComponent(lbl_status))
);
layout.linkSize(SwingConstants.HORIZONTAL, btn_inputFile, btn_outputFile, btn_searchTermFile);
layout.setVerticalGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(lbl_inputFile)
.addComponent(txt_inputFile)
.addComponent(btn_inputFile))
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(lbl_searchTermFile)
.addComponent(txt_searchTermFile)
.addComponent(btn_searchTermFile))
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(lbl_outputFile)
.addComponent(txt_outputFile)
.addComponent(btn_outputFile))
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(btn_sumbit)
.addComponent(lbl_status))
);
Run Code Online (Sandbox Code Playgroud)
任何想法如何实现我想要的?
我想创建一个包含2个组的Composite.2组具有与复合材料相同的宽度,并且可以调整大小.
Group1包含可滚动的Composite.此可滚动复合材料的固定高度= 400,包含20个文本字段==>显示V_SCROLL
Group2包含一个文本字段,高度将是动态的,最小尺寸为100,按高度复合重新调整大小 - 400(可滚动复合高度)
我尝试构建这个布局,但Group1总是完全填充复合,我看不到Group2
谢谢
没有调整我的显示器大小我的布局看起来像这样(这是非常正确的)

但是,当我调整大小时,金额会突破容器

我希望绿色区域,正文,随着文本变长或屏幕调整大小而不断缩小.我不希望任何其他东西调整大小,尤其是.不希望它突破容器.绿色区域有足够的空间来调整大小.
这是我的演示http://jsbin.com/potalu/1/edit的链接
如果你想在这里查看CSS:
.clear { clear: both; }
.transaction {
background:#ccc;
display:flex;
align-content: flex-center;
align-items: center;
position:relative;
width:100%;
}
.checkbox {
background: lighten(red, 40%);
width: 30px;
}
.checkbox .box {
width: 10px;
height:10p;
border: 1px solid orange;
}
.date {
background: lighten(blue, 30%);
width: 25px;
}
.description {
background: lighten(green, 60%);
padding-right: 10px;
flex-grow: 2;
}
.description-wrapper {
white-space:nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.amount {
background: lighten(purple, 60%);
}
.txn-amount {
width: 100%;
text-align:right;
}
Run Code Online (Sandbox Code Playgroud) 如何删除页脚栏下的空白区域?我已经删除填充:页脚下15px,但它无法正常工作.
这是网站
CSS
#bottom-footer{
background: #909090;
text-transform: initial;
padding: 15px;
font-family: 'Arial', 'sans-serif';
color: #000000;
font-weight: 300;
}
#bottom-footer .site-info{
float: left;
font-size: 14px;
color: #000;
line-height: 1.8;
}
#bottom-footer .site-page{
float: right;
font-size: 14px;
line-height: 1.8;
color:#D00000;
}
#bottom-footer .copyright{
float: right;
padding-top:20px;
margin-left:600px;
}
#bottom-footer .logos{
float: left;
padding-top:20px;
margin-right:50px;
}
Run Code Online (Sandbox Code Playgroud) 第一件事:不可能使用WPF,因为它是一个插件(对于SolidWorks)而一个用于WPF的ElementHost会导致显示错误.
我需要使ui元素相对.这意味着,如果我隐藏一些元素,我希望下面的元素缩小差距.
我尝试使用锚点和growandshrink/autosize面板 - 没有运气.
示例UI:
[Button]
[*] Checked RadioButton
[TextField]
[AnotherTextField]
[ ] Unchecked RadioButton
[Button]
Run Code Online (Sandbox Code Playgroud)
更改选定的RadioButton后,第二个RadioButton和所有后续元素应该关闭间隙,如下所示:
[Button]
[ ] Unchecked RadioButton
[*] Checked RadioButton
[Button]
Run Code Online (Sandbox Code Playgroud)