Time of Update: 2018-12-03
JTextField繼承JTextComponent類,因此它也可以使用JTextComponent抽象類別裡面許多好用的方法,如copy(),paste(),setText(),isEditable()等等。我們可以在很多地方使用JTextField,JTextField是一個單行的輸入組件。JTextField 具有建立字串的方法,此字串用作針對被激發的操作事件的命令字串。java.awt.TextField 把欄位文本用作針對 ActionEvent 的命令字串。如果通過
Time of Update: 2018-12-03
package testpicturejava; import java.awt.BorderLayout;import java.awt.Dimension; import javax.swing.JFrame;import javax.swing.JPanel;import java.awt.*;import javax.swing.JLabel;import javax.swing.ImageIcon; /** * <p>Title: </p> * * <p&
Time of Update: 2018-12-03
本身JTable沒有方法可以直接設定選擇行的前景色彩和背景色,但是我們可以通過從寫TableCellRenderer這個介面來實現我們需要的功能。此介面定義了要成為 JTable 中儲存格渲染器的任意對象所需的方法。我們通過重寫 getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
Time of Update: 2018-12-03
/*日期:2011-10-13 作者:xiaosi 題目:噴水裝置(一)*/#include<stdio.h>#include<stdlib.h>#include<math.h>int cmp(const void *a,const void *b){ return *( double *)b>*(double *)a?1:-1;}int main(){ int N; while(scanf("%d",&N)!=EOF)
Time of Update: 2018-12-03
/********************************* * 日期:2012-6-29 * 作者:SJF0115 * 題號: 九度1013 * 題目:開門人和關門人 * 結果:AC * 題意: * 總結:**********************************/#include<stdio.h>#include<stdlib.h>#include<string.h>int main(){int
Time of Update: 2018-12-03
/********************************* * 日期:2012-6-30 * 作者:SJF0115 * 題號: 九度1020 * 題目:最小長方形 * 結果:AC * 題意: * 總結:**********************************/#include<stdio.h>#include<stdlib.h>#include<string.h>int main(){int x,
Time of Update: 2018-12-03
Swing菜單和功能表項目是按鈕,因為JMenuItem擴充AbstractButton,JMenu擴充JMenuItem。因此,Swing菜單和功能表項目繼承了如下功能,即包含文本和(或)表徵圖、顯示光線標進入時的表徵圖和助記符等。 JMenuItem和JMenu的父組件,它們最後都歸於java.awt.Container,以強調菜單和功能表項目都是容器。可以把任何類型的組件(從包含一個動畫GIF的標籤到JTree的一個執行個體)添加到一個菜單或功能表項目中。 菜單和功能表項目還實現Men
Time of Update: 2018-12-03
/********************************* * 日期:2013-1-12 * 作者:SJF0115 * 題號: 九度1197 * 題目:同位 * 來源:http://ac.jobdu.com/problem.php?pid=1197 * 結果:AC * 題意: * 總結: 關鍵是十進位轉換為二進位**********************************/ #include
Time of Update: 2018-12-03
JList和ComboBox很相似,因為這兩個組件都顯示一個項列表。因此,它們都有擴充ListModel介面的模型。而且,這兩個組件都有繪製器,這些繪製器通過實現ListCellBenderer介面來繪製列表單元。 但是,列表和組合框在施工方面還是有差別的。列表單是不可編輯的,但是組合框可以配備一個編輯器。JComboBox組件把編輯工作交給實現ComboBoxEdit介面的一個對象來處理。 列表支援三個選模數式,並把選取工作實現ListSelectionModel介面的一個對象來處理。組合
Time of Update: 2018-12-03
/********************************* * 日期:2012-6-30 * 作者:SJF0115 * 題號: 九度1011 * 題目:最大連續子序列 * 結果:AC * 題意: * 總結:**********************************/#include<stdio.h>#include<stdlib.h>#include<string.h>int main(){int
Time of Update: 2018-12-03
/********************************* * 日期:2013-2-1 * 作者:SJF0115 * 題號: 九度OJ 題目17:所有員工年齡排序 * 來源:http://ac.jobdu.com/problem.php?cid=1039&pid=16 * 結果:AC * 來源:何海濤:《劍指Offer:名企面試官精講典型編程題》 * 總結:http://blog.csdn.net/sjf0115/article/
Time of Update: 2018-12-03
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of first circle should always be 1.
Time of Update: 2018-12-03
JLabel 對象可以顯示文本、映像或同時顯示二者。可以通過設定垂直和水平對齊,指定標籤顯示區中標籤內容在何處對齊。預設情況下,標籤在其顯示區內垂直置中對齊。預設情況下,只顯示文本的標籤是開始邊對齊;而只顯示映像的標籤則水平置中對齊。還可以指定文本相對於映像的位置。預設情況下,文本位於映像的結尾邊上,文本和映像都垂直對齊。 構造方法介紹: JLabel() 建立無映像並且其標題為空白字串的 JLabel。 JLabel(Icon image)
Time of Update: 2018-12-03
/********************************* * 日期:2012-7-1 * 作者:SJF0115 * 題號: 九度1023 * 題目:EXCEL排序 * 來源:http://ac.jobdu.com/problem.php?pid=1023 * 結果:AC * 題意: *
Time of Update: 2018-12-03
/********************************* * 日期:2012-6-30 * 作者:SJF0115 * 題號: 九度1021 * 題目:統計字元 * 結果:AC * 題意: * 總結:**********************************/#include <iostream>#include <string>using namespace std;string str,str1;int
Time of Update: 2018-12-03
/********************************* * 日期:2012-6-30 * 作者:SJF0115 * 題號: 九度1018 * 題目:統計同成績學生人數 * 結果:AC * 題意: * 總結:**********************************/#include<stdio.h>#include<stdlib.h>#include<string.h>int
Time of Update: 2018-12-03
__INT64的用法(一)C中,int 和long的範圍一樣,只能表示(-2^31~2^31)整數,即(-20億~20億)unsignedint 與unsignedlong 範圍是(0~2^32),40億多一點。如果要表示更大一些的整數,這兩種資料類型就不好用了,在ACM中經常要處理這樣的資料類型,以前我的笨方法是做一個整形數組,每個a[i]存一位,這樣加減乘除運算都要自己定義。剛剛看到網上的一段代碼,用的是__int64,8個位元組來儲存整數,參考了一些文章,下面介紹它的範圍和用法:*****
Time of Update: 2018-12-03
<?xml version="1.0" encoding="UTF-8"?><LinearLayout android:orientation="vertical" android:id="@+id/loginRoot"android:layout_width="fill_parent"
Time of Update: 2018-12-03
孿生素數問題時間限制:3000 ms |
Time of Update: 2018-12-03
/********************************** * 日期:2011-3-7 * 作者:SJF * 題號:357 * 結果:AC ********************************/#include<stdio.h>long long count;int coin[5]={1,5,10,25,50};long long ways[100000]={0};void calculate(){ int