label

java数组、List、Set、Map

陌路散爱 提交于 2019-12-25 17:53:10
数组是 Java 语言内置的类型,除此之外,Java有多种保存对象引用的方式。Java类库提供了一套相当完整的容器类,使用这些类的方法可以保存和操纵对象。下面分别进行讨论,在研究Java容器类之前,先了解一下Java数组的基本功能和特性。 1. 数组的基本特性 数组与 其它 种类的容器(List/Set/Map)之间的区别在于效率、确定的类型和保存基本类型数据的能力。数组是一种高效的存储和随机访问对象引用序列的方式,使用数组可以快速的访问数组中的元素。但是当创建一个数组对象(注意和对象数组的区别)后,数组的大小也就固定了,当数组空间不足的时候就再创建一个新的数组,把旧的数组中所有的引用复制到新的数组中。 Java中的数组和容器都需要进行边界检查,如果越界就会得到一个RuntimeException异常。这点和C++中有所不同,C++中vector 的操作符[]不会做边界检查,这在速度上会有一定的提高,Java的数组和容器会因为时刻存在的边界检查带来一些性能上的开销。 Java中通用的容器类不会以具体的类型来处理对象,容器中的对象都是以Object类型处理的,这是Java中所有类的基类。另外,数组可以保存基本类型,而容器不能,它只能保存任意的Java对象。 一般情况下,考虑到效率与类型检查,应该尽可能考虑使用数组。如果要解决一般化的问题,数组可能会受到一些限制

How can I get ref text when I have many refs in kivy label?

折月煮酒 提交于 2019-12-25 16:42:48
问题 Please help. I have many refs in label and when user click on first ref how can i get ref text on main.py? I need python method which can get this ref text. Label: markup: True text: "[ref=first ref]First ref[/ref] ,[ref=second ref]Second ref[/ref]" on_ref_press: # here I need method that can return ref.text 回答1: All the arguments passed to the event handler are available in kv via the args variable. The arguments to the on_ref_press handler are instance, refvalue . So, for example: Label:

Is there a easier way of creating a bordered Label in python Gtk3 than putting it in Frame?

萝らか妹 提交于 2019-12-25 15:53:13
问题 By easier i mean - can i define a style or something and apply it to all labels in my program? I have a lot of labels in it and I don't want to type so much. I heard about "Pango Style" but can I apply it to all label widgets at once? 回答1: The term: "lot of labels" is relative. Are we talking about 14 or 84? If it's closer to 84 you should probably be using Glade to create the interface then set the frames x-pad and y-pad properties. With CSS for gtk3 you'll have to pack any label in a frame

Is there a easier way of creating a bordered Label in python Gtk3 than putting it in Frame?

爷,独闯天下 提交于 2019-12-25 15:51:56
问题 By easier i mean - can i define a style or something and apply it to all labels in my program? I have a lot of labels in it and I don't want to type so much. I heard about "Pango Style" but can I apply it to all label widgets at once? 回答1: The term: "lot of labels" is relative. Are we talking about 14 or 84? If it's closer to 84 you should probably be using Glade to create the interface then set the frames x-pad and y-pad properties. With CSS for gtk3 you'll have to pack any label in a frame

C# Adding Image to a Label

橙三吉。 提交于 2019-12-25 12:55:12
问题 Now i have to developing a WindowsForm using Visual C# 2010, What I need to be able to do is on a label make their be an image. I have got the images included in the project/bin/Debug/ in a folder named "images" Image img = Image.FromFile("PR001.jpg"); Label lblImage = new Label(); lblImage.Parent = this; lblImage.Image = img; lblImage.Size = new Size(img.Width, img.Height); i need only file with extension (*.jpg) can someone help me ? 回答1: Since your images are in the "images" folder, you

Trying to create a GUI using java but not able to implement them the way i wanted

江枫思渺然 提交于 2019-12-25 12:55:09
问题 import javax.swing.*; import java.awt.*; public class SQlUI { public static void main(String[] args){ SQlUI user=new SQlUI(); user.go(); } public void go(){ //Creating a Frame JFrame frame=new JFrame(); //Creating three Panels JPanel panel0=new JPanel(); JPanel panel1=new JPanel(); JPanel panel2=new JPanel(); //Creating three Buttons JButton button0=new JButton("INSERT"); JButton button1=new JButton("UPDATE"); JButton button2=new JButton("DELETE"); //Adding panel0 to the frame which contains

Changing label text in Form2 after pressing a button in Form1

左心房为你撑大大i 提交于 2019-12-25 08:00:06
问题 How do I change a label text in Form2 after clicking a button in Form1? For example, I want the label text in Form2 to change to "Button 1 was pressed" if I pressed button1 in Form1 and if i pressed button2 in Form1, it will be "Button 2 was pressed". Note: Form1 and Form2 are not shown at the same time. So I would have to click the button and then Form2 will show up with the updated label text. 回答1: You can add an event click on button1 on your Form1 class private void button1_Click(object

Modifying the text of a label that also contains an input (checkbox)

时光毁灭记忆、已成空白 提交于 2019-12-25 07:18:06
问题 I have some elements in my document like: <div class="checkbox-inline"> <label><input id="myinputid" value="False" type="checkbox"/>mytext</label> </div> I can access get the text using: $("#myinputid").parent().text(); This returns mytext as I had hoped it would. That is: $("#myinputid").parent().text("newtext"); Changes my initial element to <div class="checkbox-inline"><label>newtext</label></div> How can I change the text part without removing the input? Or do I have to reconstruct it? If

Duplicate x-axis value in MPAndroidchart library

孤人 提交于 2019-12-25 07:14:08
问题 //map: {2-6-2016=[120.0], 27-5-2016=[100.0], 1-6-2016=[78.0, 59.0]} LineChart lineChart = (LineChart) findViewById(R.id.chart); ArrayList<Entry> graphYValues = new ArrayList<>(); ArrayList<String> xLabels = new ArrayList<String>(); for (Map.Entry<String, List<Float>> mapKeySet : map.entrySet()) { List<Float> lsValue = mapKeySet.getValue(); for (float v : lsValue) { graphYValues.add(new Entry(v, i));//value ,index xLabels.add(mapKeySet.getKey());//if same label -x-axis have multiple y-axis

Enable at runtime a series of serially named Label controls using c#

浪子不回头ぞ 提交于 2019-12-25 07:12:05
问题 I have some label control named as follows : Label1, Label2, Label3.......Label14, disabled at design time. Now i want to enable them using a for loop in the following manner for(int i=1;i<15;i++) { (Label+i).Enabled = true; } Obviously the above code does not compile. Label1.Enabled = true; Label2.Enabled = true; Label3.Enabled = true; ........... Label14.Enabled = true; Is there any other way of achieving the desired result other than the way mentioned just above.Hope i make myself clear