Controlling visibility of links in a promoted links list
I have a few links in a Promoted List app that appear as live tiles on the page. Is there a way to control the visibility of these links/tiles based on the username of the logged in user?
Any instructions/directions on how to go about this will be appreciated.
Thanks
Are you referring to the promoted sites that are set up in the user profile service? If so, there are no permissions involved. You need to create audiences in the user profile service, and target each promoted site to a specific audience of
people.
Laura Rogers
Rackspace: SharePoint Consulting
Blog: http://www.wonderlaura.com
Twitter: WonderLaura
Books:Beginning SharePoint 2010: Building Business Solutions with SharePoint
Using InfoPath 2010 with Microsoft SharePoint 2010 Step by Step
Similar Messages
-
How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM. I found that it can be
done by using XsltListViewWebPart class but how can I use this one by using shraepoint client api.
shivNice, can you point me to the solution please ?
I'm trying to do this but I get an error :
Web Part Error: Cannot complete this action. Please try again. Correlation ID: blablabla
StackTrace: at Microsoft.SharePoint.SPViewCollection.EnsureViewSchema(Boolean fullBlownSchema, Boolean bNeedInitallViews) at Microsoft.SharePoint.SPList.GetView(Guid viewGuid)
All help really appreciated. -
Controlling Cockpit (COCPCPR) link in Accounting tab (cProjects)
Hi,
How can I have the controlling cockpit (COCPCPR) link to appear in the accounting tab?
I have been able to configure the services for other object links. However, we also want the cocpcpr link to appear under the "Accounting" tab so that a user can use this link to correct cockpit errors, if any, instead of logging in to the R3 system to correct them.
Please advise.Hi Nk, thanks for responding.
We are on PPM5.0, and have accounting intergration for automatic replication to PS.
The replication works. However, we have the need to visit COCPCPR at times to remove warnings/errors.
I have seen COCPCPR link appear under the cProjects Accounting tab earlier (in some other implementation).
However, I don't see any such link/button in my implementation. We have implemented the object link services by which we are able to get to the object in R3 (in another system). However, the COCPCPR link does not appear under the Accouting tab.
We have PPM and PS on different systems.
Thanks. -
Can you create two separate tile views for a Promoted Links List
I have lots of pages on my site where i want the effect of the promoted links list tile view. However, i don't want the same links to show up on every spot i use it. Is there not a way to create separate tile views so you can create filtering conditions?
Right now i am stuck having 5 separate lists with 5 items in each because of this limitation. Am i missing something?
I look forward to your responses.
~ZachThere is an easy way to do this.
Add columns to the Promoted Links list.
Add a column named Page.
Type in name of the page on which you would like this link to appear.
Add a column named Row.
Create a view filtered by page name and Row. Example: Show only when Page = HomePage AND Row = 1
Create another view filtered by page name and another Row. Example: Show only when Page = HomePage AND Row = 2.
Go the page you would like the links to appear. Edit the Page.
Add Promoted Links app part (still not used to the app thing) and select your view for Row 1
Add another Promoted Links app part and select the view for Row 2.
Lather, Rinse and Repeat.
Tamara Bredemus SharePoint Minion...working up to Maven -
No remote control on Deck Link HD Extreme and Final Cut Estudio 2
Hi all. I have a little problem width my video card, when i update my final cut studio 2, Final Cut can't control the deck. I try with another port, KeySpan UXA 28 and he work properly. The port RS 422 deck control by Deck link appear in the list of port in Device control tab, but "no communication" message appear. I have proven with the application "Blackmagic Deck Control" and work play and stop but it does not appear the Time Code.
Any suggestion.
Thanks
G5 QUAD. Mac OS X (10.4.10) Deck Link Extreme HD. Final Cut Studio 2.Yes, I am using the 9-pin deck control connector, and i have updated the Deck Link software to 6.2 the last version.
-
How do you change the font in WPC Link List Header ...
Does any one know how/where to change the font in Web Page Composer on the Link List Header? I am using the Link List header delivered with the product.
It looks like it is pulling arial font but we are adding content in a different font in the paragraphs and want the fonts to be the same. Is there something I can change in the theme?
thanks
Angie.You need to go to the
Content Adminstration/KM Content/etc/wpceditor/css/runtime and look in the sdn_general.css file. The controls are all there. You can rename or create a new style sheet as this will modify all WPC sites. -
Links List iView: Hiding the "Organize Entries" Command
Hi all!
I am using the Links List iView to display some corporate links. This iView shows an "Organize Entries" control to update the list by default. However, in my requirement, i need to hide this command from the end user. I have taken a look on the Layout Sets involved and have not found this control; Also, i've seen on the Help System that if i change the permissions on the folder, the iView hides this control, but i've tried that and it didn't work.
Do you know how can i hide this control?
Thanks for your help!
Regards,
ThiagoHi Thiago,
I am not sure if I understood your question correctly.
When you click on 'Advanced Copy', you have several options: you can add a prefix or a suffix to the name of the LayoutSet or you can replace a prt of the name. You can find more information on this issue on help.sap.com: http://help.sap.com/saphelp_nw04/helpdata/en/30/562cbf45c5b440a2885877a1c230d5/frameset.htm
Is this what you have been looking for?
Kind reagrds
Karin -
Including Help in the Linked List Entries
Hi,
Can any one explain how to include Help text to the Linked List Entries like including normal help in the other APEX 2.2 items?
Thanks
ChitraHi santhosh
while you are creating the fieldcatalog there is a field called 'ROLLNAME' - Data element for F1 help.
If your F1 help is in reference to this data element you can specifiy it here so that it appears on the List viewer. Otherwise you have to create your own data element with the documentation and specify it here for it to appear.
In the Grid control, you can use events for triggering the same.
Hope this helps.
Reward points.
Regards
Meera -
New to java -especially linked lists
I�m trying to work with linked lists but not having much luck�
Overall, the program must create a datastructure that will hold titles of articles. Up to 10 keywords can be added to each article and it must then be possible to search all of the titles for matches to the keyword.
Currently I�m stuck in a for-loop � my linked list (articleList) is not accepted. Any help would be much appreciated. The following error occurs when I attempt to compile:
SearchMachine.java:30: cannot resolve symbol
symbol : variable articleList
location: class SearchMachine
for(ListIterator listiter = articleList.listIterator(); listiter.hasNext();)
^
import java.util.*;
class Document
private String title;
private String keywords [] = new String [10];
private int last = 0;
public Document (String _title)
String title = _title;
public void addKeyword(String kw)
if(last < 9)
keywords [last]= kw;
last ++;
System.out.println("The keyword " + kw + " has now been added");
else if (last == 9)
keywords [last]= kw;
System.out.println ("The document now has 10 keywords. No more can be added");
class SearchMachine
SearchMachine()
LinkedList articleList = new LinkedList ();
articleList.add (new Document ("Oracle 8 the new SQL programming"));
articleList.add (new Document ("Java programming made easy"));
public void print()
for(ListIterator listiter = articleList.listIterator(); listiter.hasNext();)
System.out.println(listiter.next());
public static void main (String [] args)
SearchMachine search;
search = new SearchMachine();
search.print();This is a basic scope issue. You declare the variable articleList inside the constructor block and thus it's visible only in the constructor block. The variable doesn't exist anywhere else but in SearchMachine() {...} The solution is to move the line "LinkedList articleList = new LinkedList();" three lines up, outside the constructor but inside the class definition, so that articleList becomes a member of the SearchMachine class.
-
I have a binary B+tree.
I have done all the insertion..but I have a major problem as my current node is poiting to the last node I inserted node ...
In the class I have a parent node
I want to use this to go back to the root...but I fail..function is called from a tree class
in the function {
Node curr = this;
Node temp= this.parent;
while(temp!=null) {
temp= temp.parent;
if(temp!=null) {
curr=temp;
return curr;
However, this code doesn't work...
not sure why...
can anyone help me with this .. Thanks?carl33p wrote:
Might have to fill it manually unless anyone else has an idea.
...I have a few ideas:
- keep the logic from getting input from a user separate from your linked list
class: it is not the responsibility of a linked list to perform such tasks;
- create a separate class with a main method that instantiates a linked list
and gets the user input;
- don't name one of your classes the same as one of Java's "core" classes. When
you do "import java.util.*" you might get in trouble. Since you are only storing
int's in your list, a better name would be "IntLinkedList"
- create a method called add(int) that is responsible for the addition of new
nodes;
- create a private inner class for your Node class: you won't be needing this
Node outside of your IntLinkedList class, so there's no need for it to be
"visible" for other classes.
Here's a skeleton:
class Test {
private static int getUserInput() {
// Prompt the user to enter an integer and when
// a valid integer is entered, return it.
return -1;
public static void main(String[] args) {
IntLinkedList myList = new IntLinkedList();
int nodeCount = 5;
while(nodeCount-- > 0) {
int input = getUserInput();
myList.add(input);
System.out.println("myList = "+myList.toString());
class IntLinkedList {
private Node start;
public IntLinkedList() {
start = null;
public void add(int value) {
Node newNode = new Node(value);
// Your code here
// - what to do when 'start' equals null?
// - and what to do when 'start' does not equal null?
// more methods
private class Node {
int value;
Node next;
Node(int v) {
value = v;
next = null;
// more methods
} -
What I want to do is make a Linked List that has options.
1. Allows Duplicates & Non Sorted
2. Allows Duplicates & Sorted Alphabetically
3. Allows Duplicates & Sorted Reverse Alphabetically
4. Doesn't Allow Duplicates & Non Sorted
5. Doesn't Allow Duplicates & Sorted Alphabetically
6. Doesn't Allow Duplicates & Sorted Reverse Alphabetically
sortOrder and duplicate are my global variables controlling those two options.
Reverse alphabetical and alphabetical will just be opposites.
I've got the duplicates or non duplicates part working as well as non-sorted part.
public void add(Object obj){
// post: appends the specified element to the end of this list.
Node temp = new Node(obj);
Node current = head;
Node hold = head;
// starting at the head node, crawl to the end of the list
//Takes care of duplicates
if (!duplicate) {
if (lookup(obj)) {
return;
System.out.println("OBJECT: " + obj.toString()); // See what I am passing
if (sortOrder==0) { //non-sorted
while(current.getNextNode() != null) {
current = current.getNextNode();
// the last node's "next" reference set to our new node
current.setNext(temp);
if (sortOrder<0) { // decreasing
while(current.getNextNode() != null) {
current = current.getNextNode();
System.out.println("CURRENT: " + current.getData().toString()); //Where I am sitting in the list
System.out.println("IF STATEMENT: "+ obj.toString().compareTo(current.getData().toString())); // Where the object sits alphabetically to current
if(obj.toString().compareTo(current.getData().toString())>0) {
hold.setNext(temp);
temp.setNext(current);
System.out.println("Object is closer to z Alphabetically");
return;
// the last node's "next" reference set to our new node
/* if (sortOrder>0) { // increasing
while(current.getNextNode() != null) {
current = current.getNextNode();
System.out.println("CURRENT: " + current.getData().toString());
if (obj.toString().compareTo(current.getData().toString())<0){
// the last node's "next" reference set to our new node
temp.setNext(current.getNextNode());
current.setNext(temp);
return;
}humer015 wrote:
What I want to do is make a Linked List that has options.
1. Allows Duplicates & Non Sorted
2. Allows Duplicates & Sorted Alphabetically
3. Allows Duplicates & Sorted Reverse Alphabetically
4. Doesn't Allow Duplicates & Non Sorted
5. Doesn't Allow Duplicates & Sorted Alphabetically
6. Doesn't Allow Duplicates & Sorted Reverse AlphabeticallyI'd set up 4 separate collections with the correct characteristics (6 if you think you need to keep the 'reverse order' versions separately). Remember, having 6 lists doesn't mean 6 sets of data; just 6 arrangements.
sortOrder and duplicate are my global variables controlling those two options.Sounds like an implementation decision before its time to me, unless it's dictated by programs that you have no control over. Get your lists working and then decide how you want to implement your system parameters.
HIH
Winston -
Please Hilp me ( about linked list)
i am an university student
i was write a proram by ( arrays)
thes program about Employees ( Add , Searsh , displly , delete )
it is 6 class
1 = Employee.java
2 = Boss.java
3 = CommissionWorker.java
4 = HourlyWorker.java
5 = PieceWorker.java
6 = StartProgram.java
i wona now changing the program from (Arrays) to (linked list)
this is the coodThe last 1
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class StartProgram extends JFrame
// The Components For Frame 1
private JLabel Label_Number_Of_Employee ;
private JTextField Text_Number_Of_Employee ;
private JButton Button_New, Button_Display, Button_Search, Button_UpData, Button_Delete;
private JButton Button_Exit, Button_RE;
private JPanel Panel_1_North, Panel_1_West, Panel_1_South, Panel_1_Center;
// The Components For Frame 2
private JLabel Label_Name, Label_Adress, Label_Gread, Label_ID, Label_Salary , Label_Commiss, Label_Quant, Label_Hour, Label_Wage, Label_Pice, Label_Total_Mony, Label_NumberID_FOR_Searsh;
private JTextField TextField_Total_mony, TextField_Name, TextField_Adress, TextField_Greade, TextField_ID, TextField_Salary , TextField_Commiss, TextField_Quant, TextField_Hour, TextField_Wage, TextField_Pice, TextField_NumberID_FOR_Searsh;
private JButton Button_Clear, Button_OK2, Button_Cancel, Button_Next, Button_Prev, Button_Searsh, Button_Save, Button_Delet, Button_Create;
private JRadioButton rad_Boss, rad_HourlyWorker, rad_PiceWorker, rad_CommissWorker;
private ButtonGroup radGroup;
private JPanel Panel_2_Center, Panel_2_South, Panel_2_North;
// The Container For Frame 1
Container cont;
// The Container For Frame 2
Container cont2;
// The Layouts For Frame 1 & 2
private FlowLayout layout;
private GridLayout glayout;
// private class Show_Frame2 extends JFrame
int ID_Conter_Number[] = new int[1];
Show_Frame2 Frame_Display;
Show_Frame2 Frame_Delete;
Show_Frame2 Frame_UpData;
Show_Frame2 Frame_Search;
// VARIABLES
int Text_Number_TO_int = 0;
int Countr_Index_Of_ArrayEmp = 0;
int Number_Chose_Acion;
int Conter_next = -1;
int Number_Stop_Create = 0;
int NumberID_FOR_Searsh = 0 ;
int Nu_S_S_D_F_T_F_T_T_A; // use in Set_Save_Data_From_Text_Field_To_The_Arayy();
int Number_Set_Kind_Employee; // use in Set_Save_Data_From_Text_Field_To_The_Arayy();
int Nu_S_K_E_B_R_S; // use in Set_Kind_Employee_By_radBotton_Selected()
int Nu_S_D_I_F_T_S_B_S_O_D; // use in Set_Data_in_Folds_To_Show_By_Searsh_Or_Disply()
// use in Set_Save_Data_From_Text_Field_To_The_Arayy()
int ID_set_Save_Data;
int Greade_set_Save_Data;
String Adress_set_Save_Data;
String Name_set_Save_Data;
double Salary_set_Save_Data;
int Quant_set_Save_Data;
int Hour_set_Save_Data;
int Pice_set_Save_Data;
double Wage_set_Save_Data;
double Commiss_set_Save_Data;
double Total_Mony;
// For updata
int ID_updata;
int Greade_updata;
String Adress_updata;
String Name_updata;
double Salary_updata;
int Quant_updata;
int Hour_updata;
int Pice_updata;
double Wage_updata;
double Commiss_updata;
double Total_Mony_updata;
// Arayy(s) To Keep Elements Data Of Employee
String ArayyName[];
String ArayyAdress[];
int ArayyGreade[];
int ArayyID[];
double ArayySalary[];
double ArayyCommiss[];
int ArayyQuant[];
int ArayyHour[];
double ArayyWage[];
int ArayyPice[];
int ArayyKind_Emp[];
// Arayy(s)2 To Keep A Copy Of Elements Data Of Employee
// Use in Delete Action
String ArayyName_Copy[];
String ArayyAdress_Copy[];
int ArayyGreade_Copy[];
int ArayyID_Copy[];
double ArayySalary_Copy[];
double ArayyCommiss_Copy[];
int ArayyQuant_Copy[];
int ArayyHour_Copy[];
double ArayyWage_Copy[];
int ArayyPice_Copy[];
int ArayyKind_Emp_Copy[];
// CONSRUCTOR of StartProgram class
// Open form1
public StartProgram()
super("Start To Employee System Control");
cont = getContentPane();
Panel_1_North = new JPanel(); Panel_1_North.setLayout(new GridLayout(3,0,0,0));
Panel_1_Center = new JPanel(); Panel_1_Center.setLayout(new GridLayout(6,0,0,0));
Panel_1_South = new JPanel(); Panel_1_South.setLayout(new GridLayout(1,0,0,0));
Label_Number_Of_Employee = new JLabel("Enter The Number Of Employees Then Press (ENTER) In Your KeyBoard ! ");
Text_Number_Of_Employee = new JTextField(10);
// 1- Display Button Choice To Employee System Control in form1
// 2- set Buttons Edit = false
Button_New = new JButton("Create a new an Employee(s) "); Button_New.setVisible(false);
Button_Display = new JButton("Display an Employee(s) "); Button_Display.setVisible(false);
Button_Search = new JButton("Search for an Employee(s) "); Button_Search.setVisible(false);
Button_UpData = new JButton("UpData for an Employee(s) "); Button_UpData.setVisible(false);
Button_Delete = new JButton("Delete an Employee(s) "); Button_Delete.setVisible(false);
// 1- Display Button ( EXIT & START AGEN ) in form1
// 2- set Buttons Edit = false
Button_Exit = new JButton("EXIT"); Button_Exit.setEnabled(false);
Button_RE = new JButton("START AGEN"); Button_RE.setEnabled(false);
// an object from the private class ActionHandler
ActionHandler handler = new ActionHandler();
Button_New.addActionListener(handler);
Button_Display.addActionListener(handler);
Button_Search.addActionListener(handler);
Button_UpData.addActionListener(handler);
Button_Delete.addActionListener(handler);
Button_Exit.addActionListener(handler);
Button_RE.addActionListener(handler);
Text_Number_Of_Employee.addActionListener(handler);
// Add all objects in form1
Panel_1_North.add(Label_Number_Of_Employee);
Panel_1_North.add(Text_Number_Of_Employee);
Panel_1_Center.add(Button_New);
Panel_1_Center.add(Button_Display);
Panel_1_Center.add(Button_Search);
Panel_1_Center.add(Button_UpData);
Panel_1_Center.add(Button_Delete);
Panel_1_South.add(Button_Exit);
Panel_1_South.add(Button_RE);
cont.add(Panel_1_North , BorderLayout.NORTH);
cont.add(Panel_1_Center , BorderLayout.CENTER);
cont.add(Panel_1_South , BorderLayout.SOUTH);
// setting of form1
setSize(450,350);
setVisible(true);
setResizable(false);
} // END public StartProgram()
private class ActionHandler implements ActionListener
public void actionPerformed(ActionEvent EEEE)
// ================================================
// ================================================
// if user Put A Number Then He clock Enter
if(EEEE.getSource() == Text_Number_Of_Employee)
Set_Enter_Number_Of_Employee_Start();
// ================================================
// ================================================
// Or if user clock Button Exit
else if(EEEE.getSource() == Button_Exit)
System.gc();
System.exit(0);
// ================================================
// ================================================
// if user clock Button RE START
if(EEEE.getSource() == Button_RE)
Set_Program_Start_Agen();
// ================================================
// ================================================
// if user clock Button Create a new Employee
if(EEEE.getSource() == Button_New)
Number_Chose_Acion = 1;
Show_Frame2 CCCC = new Show_Frame2();
// ================================================
// ================================================
// if user clock Button Display The Employee
if(EEEE.getSource() == Button_Display)
Number_Chose_Acion = 2;
Show_Frame2 CCCC = new Show_Frame2();
// ================================================
// ================================================
// if user clock Button Search The Employee
if(EEEE.getSource() == Button_Search)
Number_Chose_Acion = 3;
Show_Frame2 CCCC = new Show_Frame2();
// ================================================
// ================================================
// if user clock Button UpData The Employee
if(EEEE.getSource() == Button_UpData)
Number_Chose_Acion = 4;
Show_Frame2 CCCC = new Show_Frame2();
// ================================================
// ================================================
// if user clock Button Delete
if(EEEE.getSource() == Button_Delete)
Number_Chose_Acion = 5;
Show_Frame2 CCCC = new Show_Frame2();
} // END public void actionPerformed(ActionEvent e)
} // END private class ActionHandler implements ActionListener
public void Set_Enter_Number_Of_Employee_Start()
try
Text_Number_TO_int = Integer.parseInt(Text_Number_Of_Employee.getText());
if(Text_Number_TO_int <= 0)
Text_Number_Of_Employee.setText("ERROR !! Please Enter a Number More Than 0");
else
Set_Create_Lingth_Of_Arayy_By_Number_That_Entered();
catch(NumberFormatException nfe)
Text_Number_Of_Employee.setText("ERROR !! Please Enter a Number");
public void Set_Create_Lingth_Of_Arayy_By_Number_That_Entered()
ID_Conter_Number = new int[Text_Number_TO_int];
Text_Number_Of_Employee.setEditable(false);
Button_New.setVisible(true);
Button_Display.setVisible(true);
Button_Search.setVisible(true);
Button_UpData.setVisible(true);
Button_Delete.setVisible(true);
Button_Exit.setEnabled(true);
Button_RE.setEnabled(true);
ArayyName = new String[Text_Number_TO_int];
ArayyAdress = new String[Text_Number_TO_int];
ArayyGreade = new int[Text_Number_TO_int];
ArayyID = new int[Text_Number_TO_int];
ArayySalary = new double[Text_Number_TO_int];
ArayyCommiss = new double[Text_Number_TO_int];
ArayyQuant = new int[Text_Number_TO_int];
ArayyHour = new int[Text_Number_TO_int];
ArayyWage = new double[Text_Number_TO_int];
ArayyPice = new int[Text_Number_TO_int];
ArayyKind_Emp = new int[Text_Number_TO_int];
public void Set_Program_Start_Agen()
Text_Number_Of_Employee.setEditable(true);
Text_Number_Of_Employee.setText("");
Countr_Index_Of_ArrayEmp = 0;
Conter_next = -1;
Text_Number_TO_int = 0;
Countr_Index_Of_ArrayEmp = 0;
Conter_next = -1;
Nu_S_S_D_F_T_F_T_T_A = 0;
Number_Set_Kind_Employee = 0;
Number_Stop_Create = 0;
ArayyName = null ;
ArayyAdress = null ;
ArayyGreade = null ;
ArayyID = null ;
ArayySalary = null ;
ArayyCommiss = null ;
ArayyQuant = null ;
ArayyHour = null ;
ArayyWage = null ;
ArayyPice = null ;
ArayyKind_Emp = null ;
ArayyName_Copy = null ;
ArayyAdress_Copy = null ;
ArayyGreade_Copy = null ;
ArayyID_Copy = null ;
ArayySalary_Copy = null ;
ArayyCommiss_Copy = null ;
ArayyQuant_Copy = null ;
ArayyHour_Copy = null ;
ArayyWage_Copy = null ;
ArayyPice_Copy = null ;
ArayyKind_Emp_Copy = null ;
ID_set_Save_Data = 0;
Greade_set_Save_Data = 0;
Adress_set_Save_Data = null;
Name_set_Save_Data = null;
Salary_set_Save_Data = 0.00;
Quant_set_Save_Data = 0;
Hour_set_Save_Data = 0;
Pice_set_Save_Data = 0;
Wage_set_Save_Data = 0.00;
Commiss_set_Save_Data = 0.00;
// Whin User Click Any rad Button
private class RadHandler implements ItemListener
public void itemStateChanged(ItemEvent i)
Set_All_Text_Field_To_Defolt_Text();
TextField_Name.setEditable(true);
TextField_Adress.setEditable(true);
TextField_Greade.setEditable(true);
if(i.getSource() == rad_Boss)
TextField_Salary.setEditable(true);
TextField_Wage.setEditable(false);
TextField_Commiss.setEditable(false);
TextField_Quant.setEditable(false);
TextField_Hour.setEditable(false);
TextField_Pice.setEditable(false);
else if(i.getSource() == rad_HourlyWorker)
TextField_Salary.setEditable(false);
TextField_Wage.setEditable(true);
TextField_Hour.setEditable(true);
TextField_Commiss.setEditable(false);
TextField_Quant.setEditable(false);
TextField_Pice.setEditable(false);
else if(i.getSource() == rad_PiceWorker)
TextField_Salary.setEditable(false);
TextField_Wage.setEditable(true);
TextField_Hour.setEditable(false);
TextField_Quant.setEditable(false);
TextField_Commiss.setEditable(false);
TextField_Pice.setEditable(true);
else if(i.getSource() == rad_CommissWorker)
TextField_Salary.setEditable(true);
TextField_Wage.setEditable(false);
TextField_Hour.setEditable(false);
TextField_Quant.setEditable(false);
TextField_Commiss.setEditable(true);
TextField_Pice.setEditable(true);
private class Show_Frame2 extends JFrame
public Show_Frame2()
super("Control Panal Of Employee's Data");
cont2 = getContentPane();
Panel_2_Center = new JPanel();
Panel_2_Center.setLayout(new GridLayout(11,2,5,5));
Panel_2_South = new JPanel();
Panel_2_South.setLayout(new GridLayout(2,5,5,5));
Panel_2_North = new JPanel();
Panel_2_North.setLayout(new GridLayout(2,1,5,5));
Label_NumberID_FOR_Searsh = new JLabel("Employee's ID :", SwingConstants.RIGHT);
Label_NumberID_FOR_Searsh.setVisible(false);
TextField_NumberID_FOR_Searsh = new JTextField(5);
TextField_NumberID_FOR_Searsh.setVisible(false);
TextField_NumberID_FOR_Searsh.setEditable(false);
Label_Name = new JLabel("Name : " , SwingConstants.RIGHT);
Label_Adress = new JLabel("Address : " , SwingConstants.RIGHT);
Label_Gread = new JLabel("Greade : " , SwingConstants.RIGHT);
Label_ID = new JLabel("ID : " , SwingConstants.RIGHT);
Label_Salary = new JLabel("Salary : " , SwingConstants.RIGHT);
Label_Commiss = new JLabel("Commiss : " , SwingConstants.RIGHT);
Label_Quant = new JLabel("Quant : " , SwingConstants.RIGHT);
Label_Hour = new JLabel("Hours : " , SwingConstants.RIGHT);
Label_Wage = new JLabel("Wage : " , SwingConstants.RIGHT);
Label_Pice = new JLabel("Pice : " , SwingConstants.RIGHT);
Label_Total_Mony = new JLabel("Total_Money : " , SwingConstants.RIGHT);
TextField_Name = new JTextField(45);
TextField_Adress = new JTextField(45);
TextField_Greade = new JTextField(2);
TextField_ID = new JTextField(4);
TextField_Salary = new JTextField(10);
TextField_Commiss = new JTextField(10);
TextField_Quant = new JTextField(10);
TextField_Hour = new JTextField(10);
TextField_Wage = new JTextField(10);
TextField_Pice = new JTextField(10);
TextField_Total_mony = new JTextField(10); TextField_Total_mony.setEditable(false);
rad_Boss = new JRadioButton("Boss" , false);
rad_HourlyWorker = new JRadioButton("Hourly" , false);
rad_PiceWorker = new JRadioButton("Pice" , false);
rad_CommissWorker = new JRadioButton("Commiss" , false);
radGroup = new ButtonGroup();
radGroup.add(rad_Boss);
radGroup.add(rad_HourlyWorker);
radGroup.add(rad_PiceWorker);
radGroup.add(rad_CommissWorker);
//handler is object of private class RadHandler
RadHandler rHandler = new RadHandler();
rad_Boss.addItemListener(rHandler);
rad_HourlyWorker.addItemListener(rHandler);
rad_PiceWorker.addItemListener(rHandler);
rad_CommissWorker.addItemListener(rHandler);
Button_Save = new JButton("Save"); Button_Save.setVisible(false);
Button_Delet = new JButton("Delete"); Button_Delet.setVisible(false);
Button_Searsh = new JButton("Search"); Button_Searsh.setVisible(false);
Button_Next = new JButton("next");
Button_Prev = new JButton("Prev");
Button_Clear = new JButton("Clear");
Button_OK2 = new JButton("OK"); Button_OK2.setEnabled(false);
Button_Cancel = new JButton("Cancel/Menu");
Button_Create = new JButton("Create");
// ================================================
// ================================================
// of usrt click Button Clear
Button_Clear.addActionListener
new ActionListener()
public void actionPerformed(ActionEvent e)
Set_Part_Of_Text_Field_Clear_of_Text();
// ================================================
// ================================================
// of usrt click Button Cancel / Menu
Button_Cancel.addActionListener
new ActionListener()
public void actionPerformed(ActionEvent e)
setVisible(false);
// ================================================
// ================================================
// 111111111111111111111111111111111111111111111111//
// (Create new Employee)
if (Number_Chose_Acion == 1)
if (Number_Stop_Create >= Text_Number_TO_int)
JOptionPane.showMessageDialog(cont2, "You Can not add more Employees " , "Createing Will stop",JOptionPane.INFORMATION_MESSAGE);
else
set_Show_Create_employees_Form();
// ================================================
// ================================================
// 222222222222222222222222222222222222222222222222//
// ( Display Employee)
else if (Number_Chose_Acion == 2)
if (ArayyName[0] == null)
JOptionPane.showMessageDialog(cont2,"Ther are No Employees to Display", "Exception Display",JOptionPane.ERROR_MESSAGE);
else
set_Show_Display_employees_Form();
// ================================================
// ================================================
// 333333333333333333333333333333333333333333333333//
// ( Search Employee)
else if (Number_Chose_Acion == 3)
try
if (ArayyName[0] == null)
JOptionPane.showMessageDialog(cont2,"Ther are No Employees to Search", "Exception Search",JOptionPane.ERROR_MESSAGE);
else
set_Show_Search_employees_Form();
catch (Exception ex)
JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
// ================================================
// ================================================
// 444444444444444444444444444444444444444444444444//
// ( UpData Employee)
else if (Number_Chose_Acion == 4)
try
if (ArayyName[0] == null)
JOptionPane.showMessageDialog(cont2,"Ther are No Employees to UpData", "Exception UpData",JOptionPane.ERROR_MESSAGE);
else
set_Show_UpData_employees_Form();
catch (Exception ex)
JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
// ================================================
// ================================================
// 555555555555555555555555555555555555555555555555//
// ( Delete Action )
else if (Number_Chose_Acion == 5)
try
if (ArayyName[0] == null)
JOptionPane.showMessageDialog(cont2,"Ther are No Employees to Delete", "Exception Delete",JOptionPane.ERROR_MESSAGE);
else
set_Show_Delete_employees_Form();
catch (Exception ex)
JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
// ================================================
// ================================================
} // END public Show_Frame2()
// 11111111111111111111111111111111111111111
public void set_Show_Create_employees_Form()
set_Container_Of_Form2();
setTitle("Create employees");
setResizable(false);
setSize(600,500);
setVisible(true);
Set_TextField_Editable_IS_FALSE();
Conter_next = 0;
// whin Fram Create new Employee loading
Button_Next.setEnabled(false);
Button_Prev.setEnabled(false);
// of usrt click Button Create
Button_Create.addActionListener
new ActionListener()
public void actionPerformed(ActionEvent e)
// Kind of Employee that will ad is boss
if(rad_Boss.isSelected() == true)
try
int Greade_N = Integer.parseInt(TextField_Greade.getText());
if ( (Greade_N > 99) || (Greade_N < 1) )
JOptionPane.showMessageDialog(cont2," Please\nEnter Number in (Greade) Between 1 To 99", "ERROR NUMBER",JOptionPane.ERROR_MESSAGE);
else
Nu_S_S_D_F_T_F_T_T_A = Countr_Index_Of_ArrayEmp;
Number_Set_Kind_Employee = 1; // = Boss
Set_Save_Data_From_Text_Field_To_The_Arayy();
Set_All_Text_Field_To_Defolt_Text();
JOptionPane.showMessageDialog(cont2,Name_set_Save_Data + "\nwas Created As Boss", "Create",JOptionPane.INFORMATION_MESSAGE);
Countr_Index_Of_ArrayEmp ++;
Number_Stop_Create ++;
catch(Exception ex)
JOptionPane.showMessageDialog(cont2,"Please Enter Correct Data\n"+ex, "Exception",JOptionPane.ERROR_MESSAGE);
// Kind of Employee that will ad is rad_HourlyWorker
if(rad_HourlyWorker.isSelected() == true)
try
int Greade_N = Integer.parseInt(TextField_Greade.getText());
if ( (Greade_N > 99) || (Greade_N < 1) )
JOptionPane.showMessageDialog(cont2," Please\nEnter Number in (Greade) Between 1 To 99", "ERROR NUMBER",JOptionPane.ERROR_MESSAGE);
else
Nu_S_S_D_F_T_F_T_T_A = Countr_Index_Of_ArrayEmp;
Number_Set_Kind_Employee = 2; // = HourlyWorker
Set_Save_Data_From_Text_Field_To_The_Arayy();
Set_All_Text_Field_To_Defolt_Text();
JOptionPane.showMessageDialog(cont2,Name_set_Save_Data + "\nwas Created As HourlyWorker", "Create",JOptionPane.INFORMATION_MESSAGE);
Countr_Index_Of_ArrayEmp ++;
Number_Stop_Create ++;
catch(Exception ex)
JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
// Kind of Employee that will ad is rad_PiceWorker
if(rad_PiceWorker.isSelected() == true)
try
int Greade_N = Integer.parseInt(TextField_Greade.getText());
if ( (Greade_N > 99) || (Greade_N < 1) )
JOptionPane.showMessageDialog(cont2," Please\nEnter Number in (Greade) Between 1 To 99", "ERROR NUMBER",JOptionPane.ERROR_MESSAGE);
else
Nu_S_S_D_F_T_F_T_T_A = Countr_Index_Of_ArrayEmp;
Number_Set_Kind_Employee = 3; // = PiceWorker
Set_Save_Data_From_Text_Field_To_The_Arayy();
Set_All_Text_Field_To_Defolt_Text();
JOptionPane.showMessageDialog(cont2,Name_set_Save_Data + "\nwas Created As PiceWorker", "Create",JOptionPane.INFORMATION_MESSAGE);
Countr_Index_Of_ArrayEmp ++;
Number_Stop_Create ++;
-
After Delete in Linked list...unable to display the linked list
Hi...i know that there is an implementation of the class Linked Link but i am required to show how the linked list works in this case for my project...please help...
Yes..I tried to delete some objects in a linked list but after that i am not able to display the objects that were already in the linked list properly and instead it throws an NullPointerException.
Below shows the relevant coding for deleting and listing the linked list...
public Node remove(Comparator comparer) throws Exception {
boolean found = false;
Node prevnode = head; //the node before the nextnode
Node deletedNode = null; //node deleted...
//get next node and apply removal criteria
for(Node nextnode = head.getNextNode(); nextnode != null; nextnode = nextnode.getNextNode()) {
if(comparer.equals(nextnode)) {
found = true;
//remove the next node from the list and return it
prevnode.setNextNode(nextnode.getNextNode());
nextnode.setNextNode(null);
deletedNode = nextnode;
count = count - 1;
break;
if (found) return deletedNode;
else throw new Exception ("Not found !!!");
public Object[] list() {
//code to gather information into object array
Node node;
Object[] nodes = new Object[count];
node = head.getNextNode();
for (int i=0; i<count; i++) {
nodes[i] = node.getInformation(); // this is the line that cause runtime error after deleting...but before deleting, it works without problem.
node = node.getNextNode();
return nodes;
}Please help me in figuring out what went wrong with that line...so far i really can't see any problem with it but it still throws a NullPointerException
ThanksOK -- I've had a cup and my systems are coming back on line...
The problem looks to be the way that you are handling the pointer to the previous node in your deletion code. Essentially, that is not getting incremented along with the nextNode -- it is always pointing to head. So when you find the node to delete then the line
prevnode.setNextNode(nextnode.getNextNode());will set the nextNode for head to be null in certain situations (like if you are removing the tail, for instance).
Then when you try to print out the list, the first call you make is
node = head.getNextNode();Which has been set to null, so you get an NPE when you try to access the information.
Nothing like my favorite alkaloid to help things along on a Monday morning...
- N -
Problem with Queue and linked list
Hi... i've got an assignment it start like this.
You are required to write a complete console program in java includin main() to demonstrate the following:
Data Structure: Queue, Priority Queue
Object Involved: Linked-List, PrintJob
Operations Involved:
1. insert
2. remove
3. reset
4. search
Dats all... I've been given this much information... Can any1 try to help me please... How to make a start??? And wat does the print job means???
Can any1 tell me wat am supposed to do...Hi,
Why don't you start your demo like this?
import java.io.IOException;
public class Demo {
public Demo() {
public void startDemo() throws IOException {
do {
System.out.println("String Console Demo ");
System.out.println("\t" + "1. Queue Demo");
System.out.println("\t" + "2. PriorityQueue Demo");
System.out.println("\t" + "3. LinkedList Demo");
System.out.println("\t" + "4. PrintJob Demo");
System.out.println("Please choose one option");
choice = (char) System.in.read();
showDemo(choice);
} while (choice < '1' || choice > '4');
public void showDemo(char ch) {
switch (ch) {
case '1':
System.out.println("You have chosen Queue Demo ");
showOperations();
break;
case '2':
System.out.println("You have chosen Priority Queue Demo ");
showOperations();
break;
case '3':
System.out.println("You have chosen LinkedList Demo ");
showOperations();
break;
case '4':
System.out.println("You have chosen Print Job Demo ");
showOperations();
break;
private void showOperations() {
System.out.println("Please choose any operations ");
System.out.println("\t" + "1. Insert ");
System.out.println("\t" + "2. Remove ");
System.out.println("\t" + "3. Reset ");
System.out.println("\t" + "4. search ");
public static void main(String[] args) throws IOException {
Demo demo = new Demo();
demo.startDemo();
private char choice;
Write a separate classes for the data structures show the initial elements and call the methods based on the operations then show the result.
Thanks -
How to use methods when objects stored in a linked list?
Hi friend:
I stored a series of objects of certain class inside a linked list. When I get one of them out of the list, I want to use the instance method associated with this object. However, the complier only allow me to treat this object as general object, ( of Object Class), as a result I can't use instance methods which are associated with this object. Can someone tell me how to use the methods associated with the objects which are stored inside a linked list?
Here is my code:
import java.util.*;
public class QueueW
LinkedList qList;
public QueueW(Collection s) //Constructor of QuequW Class
qList = new LinkedList(s); //Declare an object linked list
public void addWaiting(WaitingList w)
boolean result = qList.isEmpty(); //true if list contains no elements
if (result)
qList.addFirst(w);
else
qList.add(w);
public int printCid()
Object d = qList.getFirst(); // the complier doesn't allow me to treat d as a object of waitingList class
int n = d.getCid(); // so I use "Object d"
return n; // yet object can't use getCid() method, so I got error in "int n = d.getCid()"
public void removeWaiting(WaitingList w)
qList.removeFirst();
class WaitingList
int cusmNo;
String cusmName;
int cid;
private static int id_count = 0;
/* constructor */
public WaitingList(int c, String cN)
cusmNo = c;
cusmName = cN;
cid = ++id_count;
public int getCid() //this is the method I want to use
return cid;Use casting. In other words, cat the object taken from the collection to the correct type and call your method.
HashMap map = /* ... */;
map.put(someKey, myObject);
((MyClass)(map.get(someKey)).myMethod();Chuck
Maybe you are looking for
-
Mobile Account Issue/Question
I have set up a Golden Triangle with Open Directory and Active Directory, everything is working fine. I can have users log into their Macs with their AD accounts, set up a mobile account so that their home directory syncs with an SMB share, but I've
-
Error in converting double to double array
Iam getting a problem while coverting the values of a table to double array local variable . while the values r getting from the resultset using while(rs.next()) all the values have to store in the double array.please give me solution to this problem
-
Cc app manager says there is an update for Photoshop - aborts at 56%
I wrote up my issue and then it never posted since it sent me to a different page. The short version: cc app manager says there is an update for Photoshop. I try to download and 56% of the way through the process it aborts and the sequence since g
-
Adobe Reader does not open any PDF when double clicked
I am using a Mac with Yosemite. When I double click a PDF to open it, it will not open. The only way it will open is right clik PDF/Open With/Applications/Adobe Reader app. or right click PDF/Quick Look. Thanks funnnyfarm
-
hi experts, i have developed a customized table in which two fields are there employee number and appraisal templates number means my user can maintain employee no. and against him the required appraisal templates name or number,for this no doubt for