我想通过JOptionPane(已经完成)重复从用户(可能使用按钮)获取输入并将详细信息存储在某物中(如何关于动态对象数组)并将此信息显示为可滚动JList中的列表.
我的代码
import java.awt.GridLayout;
import javax.swing.*;
class Flight {
public static void main(String[] args) {
//Panel
JPanel panel = new JPanel(new GridLayout(7, 2,20, 20));
//Add textfields here
JTextField txtflightno = new JTextField(8);
JTextField txtmechanicalstatus = new JTextField(8);
JTextField txtmedicalstatus = new JTextField(8);
JTextField txtfuellevel = new JTextField(8);
JTextField txtweathercondition = new JTextField(8);
JTextField txtfrequency = new JTextField(8);
JTextField txtflightpath = new JTextField(8);
//Add labels here
JLabel lblflightno = new JLabel("Flight No : ");
JLabel lblmechanicalstatus = new JLabel("Mechanical Status:");
JLabel …Run Code Online (Sandbox Code Playgroud) 我正在为语法编辑设计一个Windows窗体控件.我知道已经有很多在那里,像Scintilla的,FastColoredTextBox,Actipro语法Edito R,阿瓦隆编辑等我有设计自己的原因,所以这不是问题.
到目前为止,我一直在设计控件的外观和感觉.它需要能够垂直和水平控制.
我遇到的选项是:
我不确定哪些选项对我的控制来说是最佳实践.
我尝试使用ScrollableControl和ContainerControl,但这有一些非常不受欢迎的结果,可能是因为控件DisplayRectangle正在滚动...我不想要这个.我想滚动一个包含文本的自定义绘制矩形.
我尝试实例化HScrollBar和VScrollBar,但这看起来非常错误,并且在焦点方面效果不佳,我无法弄清楚如何正确捕获VScroll和HScroll事件.
我尝试使用ScrollBarRenderer,但这似乎只是为了实现滚动条而付出了很多努力,并且通过这种方法,我仍然必须适当地捕获和处理事件.
那么我应该使用哪种方法,或者我可能忽略了一种方法呢?
我将尝试这个:http://jquerytools.org/demos/scrollable/index.html
但没有任何事件触发器,我得到以下错误

但我很困惑,为什么on方法甚至没有找到页面加载
<head>
<link href="css/scrollable-horizontal.css" rel="stylesheet" type="text/css" />
<link href="css/scrollable-buttons.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.6.1.min.js"></script>
<script src="js/jquery.tools.min.js"></script>
</head>
Run Code Online (Sandbox Code Playgroud)
在javascript部分没有做任何事情
<script>
$(function() {
// initialize scrollable
$(".scrollable").scrollable();
});
</script>
Run Code Online (Sandbox Code Playgroud)
它阻止了我的进一步实施.对此有什么想法?
当我使用两个嵌套的 Listviews 和 ListView.builder 时,它仍然会滚动,但是具有 shirnkSwap 属性的子 Listview.builder 无法再滚动,但是我不想在小部件容器中使用 height 属性,因为它非常难看。
颤振 1.9.4 SDK
// 我的主屏幕
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFEEF0F2),
appBar: AppBar(
backgroundColor: Color(0xFF396DF0),
elevation: 0,
leading: LeadinguttonIcon(),
title: Text('TheGoal'),
actions: <Widget>[ActionIconButton()],
),
body:
ListView(children: <Widget>[TopHomeScreenBody(), BottomHomeScreen()]),
);
}
}```
**// TopHomeScreenBody**
```class TopHomeScreenBody extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ClipPath(
clipper: BodyClipper(),
child: Container(
color: Color(0xFF396DF0),
padding: EdgeInsets.only(top: 10, right: 22, left: 22, bottom: 30),
height: 250,
width: double.infinity,
child: Container( …Run Code Online (Sandbox Code Playgroud) 我需要将 vscroll 控件添加到 VB.net 中的表单,我需要使用它来滚动表单,我需要在表单中添加更多控件的表单中,表单的大小无法添加它们?
我需要知道如何进行滚动以在表单中显示更多控件?
先感谢您
我一直问这里或者我在这个布局上遇到的问题好几周了,所以这次我会展示一下我需要的东西:

我总是希望屏幕底部有一个EditText和一个按钮(当键盘出现时,它们必须出现在键盘上,而不是留在键盘下面).免费屏幕的其余部分必须是可滚动的TextView.
编辑:这是现在的代码,遵循罗曼的迹象.一切都按预期工作但滚动.TextView必须是可滚动的,而不是.怎么解决?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/consola"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars = "vertical"
android:height="0dip"
android:layout_weight="1.0"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom">
<EditText
android:id="@+id/editText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<Button
android:text="Conectar"
android:id="@+id/boton"
android:label="@string/enviar_string"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 我需要这样的东西:
http://hitconsultants.com/dragscroll_scrollsync/scrollpane.html
我有一个区域应该在每个方向都是"dragscrollable".
我尝试了很多插件,但是每个插件都有一些错误(大多数都不能用鼠标滚动或滚动条滚动).
我想测试dragscrollable插件,但jquery插件页面正在"正在构建",所以我无法下载文档等.有人如何获得这个插件或其他好的方法做dragscroll?
我正在尝试使用skrollr库(https://github.com/Prinzhorn/skrollr)来创建我认为这是一个简单的功能,这意味着当触发bottom-top属性时(顶部是在底部视口上方25px)不透明度将为0,然后当用户向下滚动时,当元素的底部比底部视口高25px时,不透明度将增加到1.
但是,当我加载html文件时,它在控制台中声明所有元素都是skrollable-after或skrollable-between,当后两个元素肯定不是这种情况时(至少当视口模糊了后两个元素时)元件).最后一个元素被声明为可滚动 - 实际上它远远低于视口的底部.
我确实认为加载各种资产可能是一个问题,但s.refresh()不会改变任何东西(至少以我使用它的方式).
HTML如下所示,skrollr.js是Github上的最新源文件(0.6.11).
任何指导将不胜感激.
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="skrollr.js"></script>
</head>
<body>
<div class="column"><p>Column 1</p>
</div>
<div class="column"><p>Column 2</p>
<div class="imp-text-one" data--25-bottom-top="opacity: 0;" data--25-bottom-bottom="opacity: 1">This is important text</div>
<div class="placeholder"></div>
<div class="imp-text-two" data--25-bottom-top="opacity: 0;" data--25-bottom-bottom="opacity: 1">This is also important text</div>
<div class="placeholder"></div>
<div class="imp-text-three" data--25-bottom-top="opacity: 0;" data--25-bottom-bottom:"opacity: 1">
This is VERY important text</div>
</div>
<script type="text/javascript">
s = skrollr.init();
</script>
<script>
window.onload = function(){
s.refresh();
}
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
CSS如下:
.column …Run Code Online (Sandbox Code Playgroud) 我想在AlertDialog中显示一个带有按钮的列表.按钮用于关闭Dialog本身.我扩展AlertDialog并增加了一些LayoutParams向Window延长整个屏幕宽度的对话框:
//Grab the window of the dialog, and change the width
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
Window window = getWindow();
lp.copyFrom(window.getAttributes());
//This makes the dialog take up the full width
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
window.setAttributes(lp);
Run Code Online (Sandbox Code Playgroud)
好.但是如果列表很长(显示已满),我可以滚动ListView但按钮下面没有显示.这是对话框的ContentView:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/choose_equipment_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:layout_below="@+id/choose_equipment_list"
android:id="@+id/btn_choose_equipment_close"
style="@style/custom_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="close" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
无论多长时间,我该怎么做才能在列表下方显示按钮?(我读了很多警告,把它ListView放进去ScrollView,无论如何都尝试过但失败了......)
我想在片段中添加一个带有 pagerview(可滚动)的选项卡。
public class MyFragment extends Fragment {
private FragmentTabHost tabHost;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
tabHost = new FragmentTabHost(getActivity());
tabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);
tabHost.addTab(tabHost.newTabSpec("one").setIndicator("One"), OneFragment.class, null);
tabHost.addTab(tabHost.newTabSpec("two").setIndicator("Two"), TwoFragment.class, null);
return tabHost;
}
@Override
public void onDestroyView(){
super.onDestroyView();
tabHost=null;
}
}
Run Code Online (Sandbox Code Playgroud)
有了这个布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.app.FragmentTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
Run Code Online (Sandbox Code Playgroud)
我尝试了几种解决方案,但都不起作用。我需要使用片段,而不是片段活动。编写的代码工作。